================ @@ -48,25 +48,17 @@ namespace { extern "C" { [[gnu::weak, gnu::leaf]] void *malloc(uint64_t Size); [[gnu::weak, gnu::leaf]] void free(void *Ptr); -} -///} +void *llvm_device_malloc(uint64_t Size) { return allocator::alloc(Size); } +void llvm_device_free(void *Ptr) { allocator::free(Ptr); } -/// AMDGCN implementations of the shuffle sync idiom. -/// -///{ #pragma omp begin declare variant match(device = {arch(amdgcn)}) -extern "C" { -void *malloc(uint64_t Size) { - // TODO: Use some preallocated space for dynamic malloc. - return nullptr; -} - -void free(void *Ptr) {} -} +void *malloc(uint64_t Size) { return llvm_device_malloc(Size); } ---------------- jhuber6 wrote:
These need to be marked weak if we want them to defer to a stronger definition of `malloc` (e.g. one coming from `libc` if linked) https://github.com/llvm/llvm-project/pull/69806 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits