Description
See https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#constant-memory
It probably only provides benefits with certain access patterns, see https://stackoverflow.com/a/18021374/392585.
This could be helpful for e.g. differentiation matrices. Unfortunately there is not yet an interfaces to use it in CUDA.jl
From Slack:
Tim Besard
2 months ago
const memory is special, and often isn’t required. it isn’t just for constant data, but requires a specific access pattern to be beneficial.Tim Besard
2 months ago
we don’t have first class support. there’s a hacky way: https://github.com/JuliaGPU/CUDA.jl/blob/5cc0ff2edd97ed51b5d96c6e5c824510cb19c22d/src/device/random.jl#L159-L202Tim Besard
2 months ago
there’s also a draft PR that would need to be reworked: JuliaGPU/CUDA.jl#552Tim Besard
2 months ago
the main problem is that there’s no good way to have constant globals that you can initialize from the host and use from the device, where the type/behavior differs on both ends.