<< All versions
Skill v1.0.0
currentLLM-judged scan90/100alizainx/intelligence-systems-skills/cuda-cpp-warp-tensor
──Details
PublishedOctober 21, 2026 at 03:26 PM
Content Hashsha256:579e5c64eab05b33...
Git SHA5d098c90c1e6
──Files
Files (1 file, 1.6 KB)
SKILL.md1.6 KBactive
SKILL.md · 26 lines · 1.6 KB
version: "1.0.0" name: cuda-cpp-warp-tensor id: ISS-044 token_budget: 700 chain_with: [triton-cutlass-fused-gpu-kernels, opencl-heterogeneous-kernels, roofline-ilp-simd-optimization] description: "CUDA C++ coalesced memory access, shared-memory bank-conflict padding, warp-level __shfl_sync reductions, and Tensor Core WMMA/MMA."
cuda-cpp-warp-tensor (ISS-044)
1. First-Principles Invariant
- Nickolls SIMT Warp-Coalescing Law: Consecutive threads (
threadIdx.x = 0..31) in a warp must access consecutive4/8/16-byteaddresses within a128-bytecache line, with zero warp divergence and zero shared-memory 32-bank conflicts.
2. Fast-Pass Low-Token Protocol (Web & Coding Agents)
- Perform intra-warp reductions in registers via
__shfl_down_sync(0xffffffffu, val, offset)before writing 1 scalar per warp to__shared__memory.
3. Zero-Bug & Zero-Vulnerability Guards
- Wrap every
cudaMalloc/cudaMemcpy/cudaStreamSynchronizeand kernel launch (cudaGetLastError()) in a deterministicCUDA_CHECK(err)macro. - Pad 2D
__shared__tiles by+1column (__shared__ float tile[32][33];) to eliminate 32-way bank conflicts on column striding. - Always pass an explicit
mask(0xffffffffuor__activemask()) to warp-synchronous intrinsics (__shfl_*_sync,__ballot_sync). - Overlap H2D/D2H transfers with compute using pinned host memory (
cudaMallocHost) and multiple non-blockingcudaStream_tstreams. - Verify race-free shared memory accesses and out-of-bounds global pointers with
compute-sanitizer --tool memcheckandracecheck.
4. Verification Gate
nvcc -std=c++17 -O3 -arch=sm_80 -Xcompiler -Wall,-Wextra,-Werror