diff --git a/ttg/ttg/parsec/devicefunc.h b/ttg/ttg/parsec/devicefunc.h index bd4c08b30..665af72f9 100644 --- a/ttg/ttg/parsec/devicefunc.h +++ b/ttg/ttg/parsec/devicefunc.h @@ -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{});