[OpenMP][libomptarget] Fix run region async condition
authorKevin Sala Penads <ksalapenades@anl.gov>
Mon, 15 Aug 2022 17:07:27 +0000 (13:07 -0400)
committerShilei Tian <i@tianshilei.me>
Mon, 15 Aug 2022 17:08:45 +0000 (13:08 -0400)
This patch fixes a condition in the openmp/libomptarget/src/device.cpp file. The code was checking if the run_region plugin API function was implemented, but it should actually check the run_region_async function instead.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D131782

openmp/libomptarget/src/device.cpp

index ddcbdc4..29b5a6c 100644 (file)
@@ -580,7 +580,7 @@ int32_t DeviceTy::dataExchange(void *SrcPtr, DeviceTy &DstDev, void *DstPtr,
 int32_t DeviceTy::runRegion(void *TgtEntryPtr, void **TgtVarsPtr,
                             ptrdiff_t *TgtOffsets, int32_t TgtVarsSize,
                             AsyncInfoTy &AsyncInfo) {
-  if (!RTL->run_region || !RTL->synchronize)
+  if (!RTL->run_region_async || !RTL->synchronize)
     return RTL->run_region(RTLDeviceID, TgtEntryPtr, TgtVarsPtr, TgtOffsets,
                            TgtVarsSize);
   return RTL->run_region_async(RTLDeviceID, TgtEntryPtr, TgtVarsPtr, TgtOffsets,