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:59:30 -0500 |
commit | 688f8132413bbfbe981c18d3b420f3c583d8c8ac (patch) | |
tree | 4501d3c03c3be87b8d5074dc710cc6df83784104 /Tools | |
parent | 90982fcea8f8c87c7e2f6121df418b4765f5edbf (diff) |
Correct loop bounds (once more)
Diffstat (limited to 'Tools')
-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 3f44ff0..817d603 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]}]]; |