[Openmp-commits] [PATCH] D94095: [libomptarget] Allow calls to omp_target_memcpy with 0 size.

George Rokos via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Jan 5 16:07:19 PST 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGdec02904d267: [libomptarget] Allow calls to omp_target_memcpy with 0 size. (authored by grokos).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94095/new/

https://reviews.llvm.org/D94095

Files:
  openmp/libomptarget/src/api.cpp


Index: openmp/libomptarget/src/api.cpp
===================================================================
--- openmp/libomptarget/src/api.cpp
+++ openmp/libomptarget/src/api.cpp
@@ -137,6 +137,11 @@
       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;
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94095.314746.patch
Type: text/x-patch
Size: 529 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210106/b8d1daaa/attachment-0001.bin>


More information about the Openmp-commits mailing list