[libc-commits] [libc] [libc] Perform bitfield zero initialization wave-parallel (PR #143607)
Joseph Huber via libc-commits
libc-commits at lists.llvm.org
Wed Jun 11 15:56:21 PDT 2025
================
@@ -157,10 +157,19 @@ struct Slab {
Header *header = reinterpret_cast<Header *>(memory);
header->chunk_size = chunk_size;
header->global_index = global_index;
+ }
- // This memset is expensive and likely not necessary for the current 'kfd'
- // driver. Until zeroed pages are exposed by the API we must be careful.
- __builtin_memset(get_bitfield(), 0, bitfield_bytes(chunk_size));
+ // Set the necessary bitfield bytes to zero in parallel using many lanes. This
+ // must be called before the bitfield can be accessed safely, memory is not
+ // guaranteed to be zero initialized in the current implementation.
+ void initialize(uint64_t uniform) {
----------------
jhuber6 wrote:
Done
https://github.com/llvm/llvm-project/pull/143607
More information about the libc-commits
mailing list