[all-commits] [llvm/llvm-project] b4bc8c: [libc] Implement efficient 'malloc' on the GPU (#1...
Joseph Huber via All-commits
all-commits at lists.llvm.org
Wed May 28 06:22:08 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: b4bc8c6f83e3dc865cf6dccdc9f18edb6a2daa3f
https://github.com/llvm/llvm-project/commit/b4bc8c6f83e3dc865cf6dccdc9f18edb6a2daa3f
Author: Joseph Huber <huberjn at outlook.com>
Date: 2025-05-28 (Wed, 28 May 2025)
Changed paths:
M libc/src/__support/GPU/CMakeLists.txt
M libc/src/__support/GPU/allocator.cpp
M libc/test/integration/src/stdlib/CMakeLists.txt
A libc/test/integration/src/stdlib/gpu/CMakeLists.txt
A libc/test/integration/src/stdlib/gpu/malloc.cpp
A libc/test/integration/src/stdlib/gpu/malloc_stress.cpp
M libc/test/src/stdlib/malloc_test.cpp
Log Message:
-----------
[libc] Implement efficient 'malloc' on the GPU (#140156)
Summary:
This is the big patch that implements an efficient device-side `malloc`
on the GPU. This is the first pass and many improvements will be made
later.
The scheme revolves around using a global reference counted pointer to
hand out access to a dynamically created and destroyed slab interface.
The slab is simply a large bitfield with one bit for each slab. All
allocations are the same size in a slab, so different sized allocations
are done through different slabs.
Allocation is thus searching for or creating a slab for the desired
slab, reserving space, and then searching for a free bit. Freeing is
clearing the bit and then releasing the space.
This interface allows memory to dynamically grow and shrink. Future
patches will have different modes to allow fast first-time-use as well
as a non-RPC version.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list