[llvm] [OpenMP] Implement 'omp_alloc' on the device (PR #102526)
Michael Klemm via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 12 06:52:19 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:
----------------
mjklemm wrote:
It's fine to map the default memory and the other types (like large capacity, HBM, etc) to the same memory space on a GPU. But it needs to be document, because that behavior is implementation-defined and thus needs to be stated in the LLVM docs.
https://github.com/llvm/llvm-project/pull/102526
More information about the llvm-commits
mailing list