Skip to content

Commit

Permalink
Add CaKernel initialisation function to the schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhinder committed Jul 25, 2012
1 parent 0e90f77 commit 7db43a1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions Tools/CodeGen/CaKernel.m
Expand Up @@ -91,8 +91,16 @@
{},
Map[kernelCCLBlock[#,OptionValue[TileSize]] &, Select[calcs, CalculationOnDevice]]]];

DefFn[CaKernelSchedule[] :=
{}];
DefFn[CaKernelSchedule[thornName_] :=
{
{
Name -> thornName <> "_Init",
SchedulePoint -> "in CCTK_BASEGRID after Accelerator_SetDevice",
Language -> "C",
Options -> "local",
Comment -> "Initialize CUDA Device"
}
}]

CaKernelConfigurationCLL[] :=
"REQUIRES CUDA MPI\n";
Expand Down
2 changes: 1 addition & 1 deletion Tools/CodeGen/Schedule.m
Expand Up @@ -303,7 +303,7 @@
{scheduleMoLRegister}];

If[OptionValue[UseCaKernel],
scheduledFunctions = Join[scheduledFunctions, CaKernelSchedule[]]];
scheduledFunctions = Join[scheduledFunctions, CaKernelSchedule[thornName]]];

allParams = Union@@((lookup[#,Parameters] &) /@ calcs);
schedule = CreateSchedule[globalStorageGroups,
Expand Down

0 comments on commit 7db43a1

Please sign in to comment.