Repository navigation
Commit 618a6cf
feat(ncu_profile): full FP16/BF16 support via signature-driven C wrapper generation
Rewrite ncu_profile.py to parse the kernel signature and generate a
type-parameterized C host wrapper. Replaces the hardcoded float-only template.
Key changes:
- Self-contained signature parser (parse_solve_signature) — no dependency on
benchmark.py, keeps ncu_profile.py standalone
- TYPE_TO_C mapping: 13 pointer types → C typename, sizeof, extra includes
- Auto-includes: cuda_fp16.h for half/__half, cuda_bf16.h for __nv_bfloat16
- Mixed-precision: each pointer param gets its own C type and element size
- All scalar params (M, N, K, etc.) parsed from CLI args
- generate_wrapper() produces complete stand-alone C file from parsed params
Tested (codegen verified on macOS):
- vectorAdd (float*, 3 ptr, 1 scalar): float *d_A/B/C, sizeof=4
- FP16 GEMM (half*, 2 in: __half sizeof=2, 1 out: float sizeof=4)
- BF16 vecAdd (__nv_bfloat16*, cuda_bf16.h auto-included)
Backward compatible: existing float/double kernels produce identical C output.
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 70a0ca6 commit 618a6cf
1 file changed
Lines changed: 287 additions & 113 deletions
0 commit comments