-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passing size==0 to DeepCopy/memcpy/omp_target_memcpy #6273
Conversation
retest this please |
Retest this please. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a test.
0-length ranges, as per this comment in core/src/OpenMPTarget/Kokkos_OpenMPTargetSpace.hpp // In the Release and RelWithDebInfo builds, the size of the memcpy should // be greater than zero to avoid error.
Removed unnecessary size check in Kokkos_Profiling.cpp Fixed size check in Kokkos_HostSpace_deepcopy.cpp Fixed size check in Kokkos_OpenMPTarget_Parallel_Common.hpp
@masterleinad Is there anything missing in this test: kokkos/core/unit_test/TestViewCopy_b.hpp Lines 205 to 239 in 1a3ea28
|
Retest this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks OK to me.
Retest this please. |
Looks like OpenMPTarget didn't run, I want to see it at least compile since a bunch of OpenMPTarget specific files were touched. |
Retest this please |
only OpenMPTarget fails, error is:
|
@@ -33,9 +33,12 @@ struct ParallelReduceCopy { | |||
static void memcpy_result(PointerType dest, PointerType src, size_t size, | |||
bool ptr_on_device) { | |||
if (ptr_on_device) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to mention, everywhere else you have
if(0<size)
if(ptr_on_device)
While here you have flipped the order of the if
conditions. Should not make a difference but just wanted to mention.
The test passed on a A100 machine. Retest this please. |
OpenMPTarget passed on retest. I am assuming that this is an intermittent failure NOT caused by this PR. |
This is to address issue #6034.
This approach is more general in that no work happens with
DeepCopy
,memcpy
oromp_target_memcpy
when a zero size is passed to it. This avoids the issue of reading an invalid pointer value.