Summary
Add a way to declare and access CUDA constant memory for small read-only parameters and lookup tables broadcast to all threads.
Motivation
Constant memory is a good fit for:
- Small coefficient tables
- Kernel config vectors reused by every thread
- Broadcast scalars that are awkward as registers-from-params at scale
WarpForth currently has global params and shared scratch only.
Proposed syntax (sketch)
\! const LUT f32[32]
\! const SCALE f64 \ optional: scalar in constant space
Access:
I CELLS LUT + C@ \ or dedicated C@/C! (store only from host)
Host:
- Runner/Python API copies bytes into the constant symbol or uses driver module constants
- Kernel sees read-only pointer / NVVM constant address space
Acceptance criteria
Non-goals
- Runtime-writable constant memory from device
- Exceeding hardware constant capacity (must error clearly)
Related
Summary
Add a way to declare and access CUDA constant memory for small read-only parameters and lookup tables broadcast to all threads.
Motivation
Constant memory is a good fit for:
WarpForth currently has global params and shared scratch only.
Proposed syntax (sketch)
\! const LUT f32[32] \! const SCALE f64 \ optional: scalar in constant spaceAccess:
Host:
Acceptance criteria
Non-goals
Related