aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorIan Hinder <ian.hinder@aei.mpg.de>2012-02-01 22:20:31 -0600
committerIan Hinder <ian.hinder@aei.mpg.de>2012-02-01 22:20:31 -0600
commit60b08902213d7720dbdcdade920643be61cd7394 (patch)
treebec4a10d4421a0634fe035aba27ba42603f8ddab /Tools
parent36db9e357a88eb5b9ebc4c9b4d781a6e1cbfea97 (diff)
Add CaKernel functions to interface.ccl
Diffstat (limited to 'Tools')
-rw-r--r--Tools/CodeGen/CaKernel.m15
-rw-r--r--Tools/CodeGen/Interface.m9
2 files changed, 21 insertions, 3 deletions
diff --git a/Tools/CodeGen/CaKernel.m b/Tools/CodeGen/CaKernel.m
index bc06ad2..7d12bf2 100644
--- a/Tools/CodeGen/CaKernel.m
+++ b/Tools/CodeGen/CaKernel.m
@@ -26,6 +26,7 @@ CaKernelCode;
CaKernelEpilogue;
CaKernelSchedule;
CaKernelConfigurationCLL;
+CaKernelInterfaceCLL;
Begin["`Private`"];
@@ -80,6 +81,20 @@ DefFn[CaKernelSchedule[] :=
CaKernelConfigurationCLL[] :=
"REQUIRES CUDA";
+CaKernelInterfaceCLL[] :=
+"
+# These functions are provided by the CaKernel thorn
+
+CCTK_INT FUNCTION Device_RegisterMem(CCTK_POINTER IN cctkGH, CCTK_INT IN vi, CCTK_INT IN num_tls)
+REQUIRES FUNCTION Device_RegisterMem
+
+CCTK_INT FUNCTION Device_UnRegisterMem(CCTK_POINTER IN cctkGH, CCTK_INT IN vi)
+REQUIRES FUNCTION Device_UnRegisterMem
+
+CCTK_POINTER FUNCTION Device_GetVarI (CCTK_POINTER IN cctkGH, CCTK_INT IN vi, CCTK_INT IN num_tls)
+REQUIRES FUNCTION Device_GetVarI
+";
+
DefFn[codeBlock[macro_String, contents:CodeGenBlock] :=
Module[
{},
diff --git a/Tools/CodeGen/Interface.m b/Tools/CodeGen/Interface.m
index 68154af..095ddf9 100644
--- a/Tools/CodeGen/Interface.m
+++ b/Tools/CodeGen/Interface.m
@@ -18,7 +18,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*)
-BeginPackage["Interface`", {"Thorn`", "KrancGroups`", "MapLookup`", "Errors`", "Helpers`", "Kranc`"}];
+BeginPackage["Interface`", {"Thorn`", "KrancGroups`", "MapLookup`", "Errors`",
+ "Helpers`", "Kranc`", "CaKernel`"}];
CreateKrancInterface;
@@ -192,7 +193,7 @@ CreateKrancInterface[nonevolvedGroups_, evolvedGroups_, rhsGroups_,
nonevolvedODEGroupStructures,
evolvedODEGroupStructures, rhsODEGroupStructures];
- interface = CreateInterface[implementation, inheritedImplementations,
+ interface = Join[CreateInterface[implementation, inheritedImplementations,
Join[includeFiles, {CactusBoundary`GetIncludeFiles[]},
{"loopcontrol.h"},
If[OptionValue[UseOpenCL], {"OpenCLRunTime.h"}, {}],
@@ -201,7 +202,9 @@ CreateKrancInterface[nonevolvedGroups_, evolvedGroups_, rhsGroups_,
UsesFunctions ->
Join[{registerEvolved, (*registerConstrained,*)
diffCoeff, getMap},
- CactusBoundary`GetUsedFunctions[]]];
+ CactusBoundary`GetUsedFunctions[]]],
+ {If[OptionValue[UseCaKernel], CaKernelInterfaceCLL[], {}]}];
+
Return[interface]];