diff options
author | Ian Hinder <ian.hinder@aei.mpg.de> | 2013-09-09 11:27:39 +0200 |
---|---|---|
committer | Ian Hinder <ian.hinder@aei.mpg.de> | 2013-09-09 11:27:39 +0200 |
commit | 18c044de4271a18f01e4f3679b7eef9369f3f5d3 (patch) | |
tree | 436b43920aeb4021c0f586ac76fa7b2fce3fbe42 | |
parent | 8b5ac2ff3696a1e59cffc0e213ca3903830834f3 (diff) |
Thorn.m: Move configuration.ccl file generation to new CodeGenConfiguration.m
-rw-r--r-- | Tools/CodeGen/CodeGenConfiguration.m | 49 | ||||
-rw-r--r-- | Tools/CodeGen/KrancThorn.m | 2 | ||||
-rw-r--r-- | Tools/CodeGen/Thorn.m | 18 |
3 files changed, 50 insertions, 19 deletions
diff --git a/Tools/CodeGen/CodeGenConfiguration.m b/Tools/CodeGen/CodeGenConfiguration.m new file mode 100644 index 0000000..d9ab554 --- /dev/null +++ b/Tools/CodeGen/CodeGenConfiguration.m @@ -0,0 +1,49 @@ + +(* Copyright 2004-2013 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[ + "CodeGenConfiguration`", + {"Errors`", "Helpers`", "Kranc`", "CodeGenKranc`", "DGFE`", "OpenCL`", + "Vectorisation`", "CaKernel`"}]; + +CreateConfiguration::usage = "Create the content of the configuration.ccl file."; + +Begin["`Private`"]; + +(* ------------------------------------------------------------------------ + Configuration file + ------------------------------------------------------------------------ *) + +Options[CreateConfiguration] = ThornOptions; + +CreateConfiguration[opts:OptionsPattern[]] := + {FileHeader["CCL"], + "REQUIRES GenericFD\n", + If[OptionValue[UseVectors], + "REQUIRES LoopControl\n", "OPTIONAL LoopControl\n{\n}\n"], + If[OptionValue[UseDGFE], DGFEConfigurationCCL[], {}], + If[OptionValue[UseOpenCL], OpenCLConfigurationCCL[], {}], + If[OptionValue[UseVectors], VectorisationConfigurationCCL[], {}], + If[OptionValue[UseCaKernel], CaKernelConfigurationCLL[], {}] + }; + +End[]; + +EndPackage[]; diff --git a/Tools/CodeGen/KrancThorn.m b/Tools/CodeGen/KrancThorn.m index d5c3697..96dbcdd 100644 --- a/Tools/CodeGen/KrancThorn.m +++ b/Tools/CodeGen/KrancThorn.m @@ -30,7 +30,7 @@ BeginPackage["KrancThorn`", {"CodeGen`", "Thorn`", "CalculationFunction`", "Errors`", "Helpers`", "CactusBoundary`", "KrancTensor`", "Param`", "Schedule`", "Interface`", "Kranc`", "Jacobian`", "ConservationCalculation`", "CaKernel`", "Calculation`", "ParamCheck`", - "OpenCL`"}]; + "OpenCL`", "CodeGenConfiguration`"}]; CreateKrancThorn::usage = "Construct a Kranc thorn"; diff --git a/Tools/CodeGen/Thorn.m b/Tools/CodeGen/Thorn.m index b83c6cf..04891c7 100644 --- a/Tools/CodeGen/Thorn.m +++ b/Tools/CodeGen/Thorn.m @@ -30,7 +30,6 @@ BeginPackage["Thorn`", "CodeGen`", "CodeGenC`", "CodeGenCactus`", "CodeGenKranc` (* These functions are externally visible, and comprise the public interface to this package. *) CreateMakefile::usage = "Create the content of the Cactus make.code.defn file."; -CreateConfiguration::usage = "Create the content of the configuration.ccl file."; CreateThorn::usage = "Create a general Cactus thorn from a thorn specification structure"; CreateSymmetriesRegistrationSource::usage = ""; @@ -54,23 +53,6 @@ CreateMakefile[sourceFiles_] := {FileHeader["Makefile"], "SRCS = ", Map[{#, " "} &, sourceFiles], "\n"}; -(* ------------------------------------------------------------------------ - Configuration file - ------------------------------------------------------------------------ *) - -Options[CreateConfiguration] = ThornOptions; - -CreateConfiguration[opts:OptionsPattern[]] := - {FileHeader["CCL"], - "REQUIRES GenericFD\n", - If[OptionValue[UseVectors], - "REQUIRES LoopControl\n", "OPTIONAL LoopControl\n{\n}\n"], - If[OptionValue[UseDGFE], DGFEConfigurationCCL[], {}], - If[OptionValue[UseOpenCL], OpenCLConfigurationCCL[], {}], - If[OptionValue[UseVectors], VectorisationConfigurationCCL[], {}], - If[OptionValue[UseCaKernel], CaKernelConfigurationCLL[], {}] - }; - (* ------------------------------------------------------------------------ Setter |