From 5f9725d51592693d284a1b9e4884cd470dbe0bac Mon Sep 17 00:00:00 2001 From: Alejandro Gallo Date: Fri, 30 Sep 2022 14:35:28 +0200 Subject: [PATCH] Add forgotten memcpy for SelfSufficient buffers --- include/atrip/SliceUnion.hpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/include/atrip/SliceUnion.hpp b/include/atrip/SliceUnion.hpp index 1f8c826..28fd019 100644 --- a/include/atrip/SliceUnion.hpp +++ b/include/atrip/SliceUnion.hpp @@ -208,15 +208,14 @@ template auto dataPointer = freePointers.begin(); freePointers.erase(dataPointer); blank.data = *dataPointer; - // - // - // TODO [#A]: do cuMemcpy of - // sources[from.source].data() ⇒ blank.data - // Do this when everything else is working. - // This will probably be a bottleneck of the H-to-D communication, - // as most slices are SelfSufficient. - // - // + WITH_CHRONO("cuda:memcpy", + WITH_CHRONO("cuda:memcpy:self-sufficient", + _CHECK_CUDA_SUCCESS("copying mpi data to device", + cuMemcpyHtoD(blank.data, + (void*)sources[from.source].data(), + sizeof(F) * sources[from.source].size())); + )) + #else blank.data = sources[from.source].data(); #endif