aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorIan Hinder <ian.hinder@aei.mpg.de>2013-09-06 23:44:19 +0200
committerIan Hinder <ian.hinder@aei.mpg.de>2013-09-06 23:44:19 +0200
commitff6d8a0a9c94483d5818835bef95ebd4325407d9 (patch)
tree53c5f47b9d3a1a801e1f306a65b4c3c45538add9 /Tools
parent532fd21055868f3d54f71e658cbc12873dae30c2 (diff)
CalculationFunction.m: Move OpenCL prologue into OpenCL.m
Diffstat (limited to 'Tools')
-rw-r--r--Tools/CodeGen/CalculationFunction.m9
-rw-r--r--Tools/CodeGen/OpenCL.m33
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[];