[Openmp-commits] [PATCH] D144525: [OpenMP] Target memory allocator fallback to default when no device available

Nawrin Sultana via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Feb 22 10:03:50 PST 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGae46cd72aa07: [OpenMP] Target memory allocator fallback to default when no device available (authored by Nawrin).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144525

Files:
  openmp/runtime/src/i18n/en_US.txt
  openmp/runtime/src/kmp_alloc.cpp


Index: openmp/runtime/src/kmp_alloc.cpp
===================================================================
--- openmp/runtime/src/kmp_alloc.cpp
+++ openmp/runtime/src/kmp_alloc.cpp
@@ -1588,8 +1588,10 @@
         ptr = kmp_target_alloc_shared(size, device);
       else // allocator == llvm_omp_target_device_mem_alloc
         ptr = kmp_target_alloc_device(size, device);
+      return ptr;
+    } else {
+      KMP_INFORM(TargetMemNotAvailable);
     }
-    return ptr;
   }
 
   if (allocator >= kmp_max_mem_alloc && KMP_IS_TARGET_MEM_SPACE(al->memspace)) {
@@ -1602,8 +1604,10 @@
         ptr = kmp_target_alloc_shared(size, device);
       else // al->memspace == llvm_omp_target_device_mem_space
         ptr = kmp_target_alloc_device(size, device);
+      return ptr;
+    } else {
+      KMP_INFORM(TargetMemNotAvailable);
     }
-    return ptr;
   }
 
   if (__kmp_memkind_available) {
Index: openmp/runtime/src/i18n/en_US.txt
===================================================================
--- openmp/runtime/src/i18n/en_US.txt
+++ openmp/runtime/src/i18n/en_US.txt
@@ -479,6 +479,7 @@
 AffHWSubsetAllFiltered       "KMP_HW_SUBSET ignored: all hardware resources would be filtered, please reduce the filter."
 AffHWSubsetAttrsNonHybrid    "KMP_HW_SUBSET ignored: Too many attributes specified. This machine is not a hybrid architecutre."
 AffHWSubsetIgnoringAttr      "KMP_HW_SUBSET: ignoring %1$s attribute. This machine is not a hybrid architecutre."
+TargetMemNotAvailable        "Target memory not available, will use default allocator."
 
 # --------------------------------------------------------------------------------------------------
 -*- HINTS -*-


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144525.499566.patch
Type: text/x-patch
Size: 1677 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20230222/93d79def/attachment-0001.bin>


More information about the Openmp-commits mailing list