| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[libc] Rework match any use in hot allocate bitfield loop Summary: We previously used match_all as the shortcut to figure out which threads were destined for which slots. This lowers to a for-loop, which even if it often only executes once still causes some slowdown especially when divergent. Instead we use a single ballot call and then calculate it. Here the ballot tells us which lanes are the first in a block, either the starting index or the barrier for a new 32-bit int. We then use some bit magic to figure out for each lane ID its closest leader. For the length we simply use the length calculated by the leader of the remaining bits to be written. This removes the match any and the shuffle, which improves the minimum number of cycles this takes by about 5%. | 1 年前 | |
[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. | 1 年前 | |
[libc][stdlib] Simplify getenv_test by using strcmp instead of custom helper (#163055) [libc][stdlib] Simplify getenv_test by using inline_strcmp instead of custom helper Replace the custom my_streq helper function with LLVM libc's inline_strcmp utility from src/string/memory_utils/inline_strcmp.h. Changes: - Remove 18-line custom my_streq implementation - Use inline_strcmp with a simple comparator lambda for string comparisons - Replace my_streq(..., nullptr) checks with direct == nullptr comparisons - Maintain identical test coverage while reducing code duplication Benefits: - Uses existing, well-tested LLVM libc infrastructure - Clearer test assertions with standard comparison functions - More concise code (reduced from ~48 to ~33 lines) - Consistent with LLVM libc coding practices The test continues to verify: - Empty string handling - Invalid name handling ('=') - Missing environment variable queries - Correct retrieval of existing variables (FRANCE, GERMANY, PATH) - Partial name matching behavior (FRANC vs FRANCE, FRANCE1 vs FRANCE) | 9 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 年前 | ||
| 1 年前 | ||
| 9 个月前 |