Skip to content

Commit

Permalink
[libc] Use __builtin_ffsll for RPC lane mask (#85000)
Browse files Browse the repository at this point in the history
src/__support/GPU/utils.h doesn't compile on a 32-bit platforms because
__builtin_ffsl uses long which is a 32-bit number. Use __builtin_ffsll
which uses long long which is guaranteed to be at least 64-bits.
  • Loading branch information
petrhosek committed Mar 13, 2024
1 parent 16ae493 commit c6a93fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libc/src/__support/GPU/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace LIBC_NAMESPACE {
namespace gpu {
/// Get the first active thread inside the lane.
LIBC_INLINE uint64_t get_first_lane_id(uint64_t lane_mask) {
return __builtin_ffsl(lane_mask) - 1;
return __builtin_ffsll(lane_mask) - 1;
}

/// Conditional that is only true for a single thread in a lane.
Expand Down

0 comments on commit c6a93fe

Please sign in to comment.