__popc counts set bits: Lori's 31 beats Alice's single high bit

cfregly · x · 2026-11-11

cfregly illustrates CUDA's popc intrinsic: Alice's mask 0x80000000 holds only the high bit (larger unsigned value), while Lori's 0x7FFFFFFF has 31 set bits — popc counts each once, so Lori wins 31 to 1. Links to NVIDIA's CUDA Math API Integer Intrinsics docs (brev, clz, dp2a, etc.).

Related event: Illustrating __popc Bit Counting and the Tensor Core vs CUDA Core Division of Labor(2 posts)→

Original post →

More from Infra

Infra channel →