Commits

Christos Kannas  committed c158c34

Update: Assign values to constant arrays.

  • Participants
  • Parent commits ef21957

Comments (0)

Files changed (1)

       fprintf(stderr, ">>> CUDA - constant device variables <<<\n");
 
       C_Inline("/* Column compressed Stoichiometric matrix */");
-      C_Inline("%s double d_STOICM[NSTOICM] = STOICM;", CUDA_C_variable_qualifiers[1]);
-      C_Inline("%s int d_CCOL_STOICM[CNEQN] = CCOL_STOICM;", CUDA_C_variable_qualifiers[1]);
+      //C_Inline("%s double d_STOICM[NSTOICM] = STOICM;", CUDA_C_variable_qualifiers[1]);
+      C_Inline("%s double d_STOICM[%d] = {", CUDA_C_variable_qualifiers[1], nnz_stoicm);
+	  for(i = 0; i < nnz_stoicm; ++i){
+		C_Inline("\t%d,", stoicm[i]);
+	  }
+      C_Inline("};");
+      NewLines(1);
+	  
+      //C_Inline("%s int d_CCOL_STOICM[CNEQN] = CCOL_STOICM;", CUDA_C_variable_qualifiers[1]);
+	  C_Inline("%s int d_CCOL_STOICM[%d] = {", CUDA_C_variable_qualifiers[1], EqnNr+1);
+	  for(i = 0; i <= EqnNr; ++i){
+		C_Inline("\t%d,", ccol_stoicm[i]);
+	  }
+      C_Inline("};");
+      NewLines(1);
 
       C_Inline("/* For each reaction equation find which species are used */");
       C_Inline("%s int Spc_Idx[%d] = {", CUDA_C_variable_qualifiers[1], (EqnNr * SpcNr));