Skip to content

Commit 8934a6e

Browse files
authored
[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.
1 parent 962ee7a commit 8934a6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

offload/DeviceRTL/src/State.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ namespace {
5050
///
5151
///{
5252
extern "C" {
53-
#ifdef __AMDGPU__
53+
#if defined(__AMDGPU__) && !defined(OMPTARGET_HAS_LIBC)
5454

5555
[[gnu::weak]] void *malloc(size_t Size) { return allocator::alloc(Size); }
5656
[[gnu::weak]] void free(void *Ptr) { allocator::free(Ptr); }

0 commit comments

Comments
 (0)