mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 21:55:39 +08:00
[OpenMP] Use the libc malloc for AMDGPU if available (#151241)
Summary: This patch enables the OpenMP runtime to use the general-purpose `malloc` interface in `libc` if the user built OpenMP with it enabled. All this requires is keeping `malloc` as an external function so it will be resolved later by the linker.
This commit is contained in:
@@ -50,7 +50,7 @@ namespace {
|
||||
///
|
||||
///{
|
||||
extern "C" {
|
||||
#ifdef __AMDGPU__
|
||||
#if defined(__AMDGPU__) && !defined(OMPTARGET_HAS_LIBC)
|
||||
|
||||
[[gnu::weak]] void *malloc(size_t Size) { return allocator::alloc(Size); }
|
||||
[[gnu::weak]] void free(void *Ptr) { allocator::free(Ptr); }
|
||||
|
||||
Reference in New Issue
Block a user