projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cbda2cb
)
[libomptarget] Allow calls to omp_target_memcpy with 0 size.
author
George Rokos
<georgios.rokos@intel.com>
Wed, 6 Jan 2021 00:03:53 +0000
(16:03 -0800)
committer
George Rokos
<georgios.rokos@intel.com>
Wed, 6 Jan 2021 00:03:53 +0000
(16:03 -0800)
Differential Revision: https://reviews.llvm.org/D94095
openmp/libomptarget/src/api.cpp
patch
|
blob
|
history
diff --git
a/openmp/libomptarget/src/api.cpp
b/openmp/libomptarget/src/api.cpp
index
58f7cec
..
2d37610
100644
(file)
--- a/
openmp/libomptarget/src/api.cpp
+++ b/
openmp/libomptarget/src/api.cpp
@@
-137,6
+137,11
@@
EXTERN int omp_target_memcpy(void *dst, void *src, size_t length,
DPxPTR(src), dst_offset, src_offset, length);
if (!dst || !src || length <= 0) {
+ if (length == 0) {
+ DP("Call to omp_target_memcpy with zero length, nothing to do\n");
+ return OFFLOAD_SUCCESS;
+ }
+
REPORT("Call to omp_target_memcpy with invalid arguments\n");
return OFFLOAD_FAIL;
}