← Kernels & Compilers
Advanced
Parallel Prefix Scan and Stream Compaction
A prefix scan gives every item the aggregate of earlier items. It turns per-item counts into disjoint output offsets and enables stable compaction, provided block carries and integer limits are handled correctly.
This concept is part of Premium, which includes all concepts, course lessons and answers.
Get Premium · ₹2,000 / $256 months of access · one payment · no auto-renew
RELATED CONCEPTS
LESSONS THAT TEACH THIS
PRACTICE THIS IN REAL QUESTIONS
CUDA, Triton & Kernel EngineeringEach GPU block computes correct local offsets, but output ranges overlap. What is missing?→Coding for InfraImplement a log-structured event store for fleet metrics with range queries and compaction.→CUDA, Triton & Kernel EngineeringWrite a CUDA vector add and explain the launch: grid math, the bounds check, and why the copies dominate.→CUDA, Triton & Kernel EngineeringWhat is memory coalescing, why does a strided access pattern hurt, and how do you see it in a profiler?→CUDA, Triton & Kernel EngineeringGiven the addresses each thread in a warp touched, classify the access pattern: coalesced, strided or random. Write the classifier.→CUDA, Triton & Kernel EngineeringExplain shared memory bank conflicts with the bank arithmetic, show a kernel that has them, and fix it with padding.→
