xref: /llvm-project/libc/src/stdlib/gpu/free.cpp (revision 256f40d0e6b2beb0e951b0f5f836847223c5695c)
1a6213088SJoseph Huber //===-- GPU Implementation of free ----------------------------------------===//
2a6213088SJoseph Huber //
3a6213088SJoseph Huber // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4a6213088SJoseph Huber // See https://llvm.org/LICENSE.txt for license information.
5a6213088SJoseph Huber // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6a6213088SJoseph Huber //
7a6213088SJoseph Huber //===----------------------------------------------------------------------===//
8a6213088SJoseph Huber 
9a6213088SJoseph Huber #include "src/stdlib/free.h"
10ea697dccSJoseph Huber 
11ea697dccSJoseph Huber #include "src/__support/GPU/allocator.h"
12a6213088SJoseph Huber #include "src/__support/common.h"
135ff3ff33SPetr Hosek #include "src/__support/macros/config.h"
14a6213088SJoseph Huber 
155ff3ff33SPetr Hosek namespace LIBC_NAMESPACE_DECL {
16a6213088SJoseph Huber 
17*256f40d0SJoseph Huber // FIXME: For now we just default to the NVIDIA device allocator which is
18*256f40d0SJoseph Huber // always available on NVPTX targets. This will be implemented fully later.
19*256f40d0SJoseph Huber #ifndef LIBC_TARGET_ARCH_IS_NVPTX
20ea697dccSJoseph Huber LLVM_LIBC_FUNCTION(void, free, (void *ptr)) { gpu::deallocate(ptr); }
21*256f40d0SJoseph Huber #endif
22a6213088SJoseph Huber 
235ff3ff33SPetr Hosek } // namespace LIBC_NAMESPACE_DECL
24