diff options
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/CodeGen/CalculationFunction.m | 9 | ||||
-rw-r--r-- | Tools/CodeGen/OpenCL.m | 33 |
2 files changed, 35 insertions, 7 deletions
diff --git a/Tools/CodeGen/CalculationFunction.m b/Tools/CodeGen/CalculationFunction.m index a786aa3..d8948cd 100644 --- a/Tools/CodeGen/CalculationFunction.m +++ b/Tools/CodeGen/CalculationFunction.m @@ -23,7 +23,7 @@ BeginPackage["CalculationFunction`", {"CodeGenCactus`", "CodeGenC`", "CodeGen`", "CodeGenKranc`", "MapLookup`", "KrancGroups`", "Differencing`", "Errors`", "Helpers`", "Kranc`", "Optimize`", "Jacobian`", "Profile`", "Vectorisation`", - "Calculation`", "DGFE`"}]; + "Calculation`", "DGFE`", "OpenCL`"}]; CreateCalculationFunction::usage = ""; GridFunctionsInExpression; @@ -338,12 +338,7 @@ DefFn[ lookup[calcp,BodyFunction][{ (* OpenCL kernel prologue *) (* We could (or probably should) write this into a source file of its own *) - If[OptionValue[UseOpenCL], - { - "const char* const source =\n" - }, - { - }], + If[OptionValue[UseOpenCL], {OpenCLPrologue[]}, {}], If[OptionValue[UseOpenCL], Stringify, Identity][{ diff --git a/Tools/CodeGen/OpenCL.m b/Tools/CodeGen/OpenCL.m new file mode 100644 index 0000000..8619b2b --- /dev/null +++ b/Tools/CodeGen/OpenCL.m @@ -0,0 +1,33 @@ + +(* Copyright 2004 Sascha Husa, Ian Hinder, Christiane Lechner + + This file is part of Kranc. + + Kranc is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + Kranc is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Kranc; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*) + +BeginPackage["OpenCL`", {"Errors`", "Helpers`", "Kranc`"}]; + +OpenCLPrologue; + +Begin["`Private`"]; + +DefFn[ + OpenCLPrologue[] := + "const char* const source =\n"]; + +End[]; + +EndPackage[]; |