diff options
author | Erik Schnetter <schnetter@gmail.com> | 2013-01-20 09:58:33 -0500 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2013-01-20 09:58:33 -0500 |
commit | a66b3b1a0937bf9cde53f5469b50491d7e2847d7 (patch) | |
tree | 50a80699be6fa2181fe5f9a665c6c1724d2c3738 /Tools/CodeGen/CalculationFunction.m | |
parent | 5e05812c6134b849246fa133ccedc396577277f8 (diff) |
Correct loop bounds (once more)
Diffstat (limited to 'Tools/CodeGen/CalculationFunction.m')
-rw-r--r-- | Tools/CodeGen/CalculationFunction.m | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/Tools/CodeGen/CalculationFunction.m b/Tools/CodeGen/CalculationFunction.m index e4330d5..b47576e 100644 --- a/Tools/CodeGen/CalculationFunction.m +++ b/Tools/CodeGen/CalculationFunction.m @@ -759,7 +759,7 @@ DefFn[ "char const *const sources[] = {differencing, source, NULL};\n", "OpenCLRunTime_CallKernel(cctkGH, CCTK_THORNSTRING, \"" <> functionName <> "\",\n", " sources, groups, NULL, NULL, NULL, -1,\n", - " kimin, kimax, &kernel);\n\n" + " imin, imax, &kernel);\n\n" }, { }] @@ -999,13 +999,19 @@ DefFn[ Map[InfoVariable[#[[1]]] &, (eqs2 /. localMap)], ""], - If[OptionValue[UseVectors] || OptionValue[UseOpenCL], - CommentedBlock["Copy local copies back to grid functions", - { PrepareStorePartialVariableInLoop["i", "kimin", "kimax"], - Map[StorePartialVariableInLoop[gridName[#], localName[#]] &, - gfsInLHS] }], - CommentedBlock["Copy local copies back to grid functions", - Map[AssignVariableInLoop[gridName[#], localName[#]] &, gfsInLHS]]], + Which[OptionValue[UseOpenCL], + CommentedBlock["Copy local copies back to grid functions", + { PrepareStorePartialVariableInLoop["i", "lc_imin", "lc_imax"], + Map[StorePartialVariableInLoop[gridName[#], localName[#]] &, + gfsInLHS] }], + OptionValue[UseVectors], + CommentedBlock["Copy local copies back to grid functions", + { PrepareStorePartialVariableInLoop["i", "kimin", "kimax"], + Map[StorePartialVariableInLoop[gridName[#], localName[#]] &, + gfsInLHS] }], + True, + CommentedBlock["Copy local copies back to grid functions", + Map[AssignVariableInLoop[gridName[#], localName[#]] &, gfsInLHS]]], If[debugInLoop, Map[InfoVariable[gridName[#]] &, gfsInLHS], ""]}, opts]}]]; |