aboutsummaryrefslogtreecommitdiff
path: root/Carpet/Carpet/src/CallFunction.cc
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2012-02-02 13:36:18 -0600
committerBarry Wardell <barry.wardell@gmail.com>2012-09-11 18:17:58 +0100
commit4e3b65463a16a0fc66724ab72c4dec9b3f31dbd4 (patch)
treee96dee0cd32584cff8beb01ced0ee9bee15f0781 /Carpet/Carpet/src/CallFunction.cc
parentead4d3203389858d2982ceaba4f235a7b51c7e30 (diff)
Support accelerator data transfer
This patch provides a function interface for accelerator (GPU) devices to be called at certain points when Carpet traverses the schedule tree. This can be used to copy data between the host (CPU) and the device (GPU) as it is needed. --- Carpet/Carpet/interface.ccl | 28 ++++++++++++++++++++++++++++ Carpet/Carpet/param.ccl | 6 ++++++ Carpet/Carpet/src/CallFunction.cc | 12 ++++++++++++ Carpet/Carpet/src/Comm.cc | 8 ++++++++ Carpet/Carpet/src/Cycle.cc | 4 ++++ Carpet/Carpet/src/Evolve.cc | 2 ++ Carpet/Carpet/src/Initialise.cc | 2 ++ Carpet/Carpet/src/Requirements.cc | 34 ++++++++++++++++++++++------------ Carpet/Carpet/src/variables.cc | 3 +++ Carpet/Carpet/src/variables.hh | 3 +++ 10 files changed, 90 insertions(+), 12 deletions(-)
Diffstat (limited to 'Carpet/Carpet/src/CallFunction.cc')
-rw-r--r--Carpet/Carpet/src/CallFunction.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/Carpet/Carpet/src/CallFunction.cc b/Carpet/Carpet/src/CallFunction.cc
index 936c8525d..e0550907b 100644
--- a/Carpet/Carpet/src/CallFunction.cc
+++ b/Carpet/Carpet/src/CallFunction.cc
@@ -332,8 +332,20 @@ namespace Carpet {
user_timer.start();
timer.start();
+ if (CCTK_IsFunctionAliased("Accelerator_PreCallFunction")) {
+ Timer pre_timer("PreCall");
+ pre_timer.start();
+ Accelerator_PreCallFunction(cctkGH, attribute);
+ pre_timer.stop();
+ }
int const res = CCTK_CallFunction (function, attribute, data);
assert (res==0);
+ if (CCTK_IsFunctionAliased("Accelerator_PostCallFunction")) {
+ Timer post_timer("PostCall");
+ post_timer.start();
+ Accelerator_PostCallFunction(cctkGH, attribute);
+ post_timer.stop();
+ }
timer.stop();
user_timer.stop();