From ff6d8a0a9c94483d5818835bef95ebd4325407d9 Mon Sep 17 00:00:00 2001 From: Ian Hinder Date: Fri, 6 Sep 2013 23:44:19 +0200 Subject: CalculationFunction.m: Move OpenCL prologue into OpenCL.m --- Tools/CodeGen/CalculationFunction.m | 9 ++------- Tools/CodeGen/OpenCL.m | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 Tools/CodeGen/OpenCL.m (limited to 'Tools') 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[]; -- cgit v1.2.3