[llvm] [OpenMP] Implement 'omp_alloc' on the device (PR #102526)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 8 20:23:52 PDT 2024


================
@@ -128,6 +129,33 @@ double omp_get_wtime(void) { return ompx::impl::getWTime(); }
 void *__llvm_omp_indirect_call_lookup(void *HstPtr) {
   return ompx::impl::indirectCallLookup(HstPtr);
 }
+
+void *omp_alloc(size_t size, omp_allocator_handle_t allocator) {
+  switch (allocator) {
+  case omp_default_mem_alloc:
+  case omp_large_cap_mem_alloc:
----------------
shiltian wrote:

I think we need folks from the committee to clarify what the expected behavior would be on the device from the spec's perspective. @mjklemm @dreachem 

https://github.com/llvm/llvm-project/pull/102526


More information about the llvm-commits mailing list