Skip to content

Commit

Permalink
Don't attempt d2h copy if owner is the host
Browse files Browse the repository at this point in the history
Signed-off-by: Joseph Schuchart <[email protected]>
  • Loading branch information
devreal committed Sep 16, 2024
1 parent 9e3dd92 commit 7193769
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions ttg/ttg/parsec/devicefunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,14 @@ namespace ttg_parsec {
parsec_gpu_task_t *gpu_task = detail::parsec_ttg_caller->dev_ptr->gpu_task;
parsec_gpu_exec_stream_t *stream = detail::parsec_ttg_caller->dev_ptr->stream;

/* enqueue the transfer into the compute stream to come back once the compute and transfer are complete */
parsec_device_gpu_module_t *device_module = detail::parsec_ttg_caller->dev_ptr->device;
device_module->memcpy_async(device_module, stream,
data->device_copies[0]->device_private,
data->device_copies[data->owner_device]->device_private,
data->nb_elts, parsec_device_gpu_transfer_direction_d2h);

if (data->owner_device != 0) {
/* enqueue the transfer into the compute stream to come back once the compute and transfer are complete */
parsec_device_gpu_module_t *device_module = detail::parsec_ttg_caller->dev_ptr->device;
device_module->memcpy_async(device_module, stream,
data->device_copies[0]->device_private,
data->device_copies[data->owner_device]->device_private,
data->nb_elts, parsec_device_gpu_transfer_direction_d2h);
}
if constexpr (sizeof...(Is) > 0) {
// recursion
mark_device_out(views, std::index_sequence<Is...>{});
Expand Down

0 comments on commit 7193769

Please sign in to comment.