From e69ab5bd00ff28547a68031815a20ad6bc6aa4f5 Mon Sep 17 00:00:00 2001 From: Ian Hinder Date: Fri, 6 Sep 2013 23:52:36 +0200 Subject: CalculationFunction.m: Move OpenCL epilogue to OpenCL.m --- Tools/CodeGen/CalculationFunction.m | 27 ++------------------------- Tools/CodeGen/OpenCL.m | 27 ++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 26 deletions(-) (limited to 'Tools/CodeGen') diff --git a/Tools/CodeGen/CalculationFunction.m b/Tools/CodeGen/CalculationFunction.m index d8948cd..27e65c0 100644 --- a/Tools/CodeGen/CalculationFunction.m +++ b/Tools/CodeGen/CalculationFunction.m @@ -367,31 +367,8 @@ DefFn[ }], (* OpenCL kernel epilogue *) - If[OptionValue[UseOpenCL], - { - ";\n\n", - Module[ - {ignoreGroups, groupsNames, groupNameList}, - ignoreGroups = {"TmunuBase::stress_energy_scalar", - "TmunuBase::stress_energy_vector", - "TmunuBase::stress_energy_tensor"}; - groupNames = GroupsInCalculation[cleancalc, imp]; - groupNames = Select[groupNames, !MemberQ[ignoreGroups, #] &]; - { - "const char* const groups[] = {\n ", - Riffle[Join[Map[Quote, groupNames], {"NULL"}], ",\n "], - "};\n\n" - } - ], - "static struct OpenCLKernel *kernel = NULL;\n", - "const char* const sources[] = {differencing, source, NULL};\n", - "OpenCLRunTime_CallKernel(cctkGH, CCTK_THORNSTRING, \"" <> functionName <> "\",\n", - " sources, groups, NULL, NULL, NULL, -1,\n", - " imin, imax, &kernel);\n\n" - }, - { - }] - }], + If[OptionValue[UseOpenCL], OpenCLEpilogue[cleancalc, imp, functionName], {}] + }], (* functionName <> "\",\n", + " sources, groups, NULL, NULL, NULL, -1,\n", + " imin, imax, &kernel);\n\n" + }]; + End[]; EndPackage[]; -- cgit v1.2.3