coder.gpu.persistentMemory
Description
coder.gpu.persistentMemory(
maps the
persistent MATLAB® variable pvar
)pvar
to the CUDA® enabled NVIDIA® GPU as variable with persistent memory. The variable must be fixed size and of
a data type supported for GPU code generation.
This is a code generation function. It has no effect in MATLAB.
Note
For CUDA MEX, the persistent memory on the GPU is retained during the entirety of
the MATLAB session. For freeing the GPU memory, use the clear mex
MATLAB command. For freeing the GPU memory in static libraries, dynamic
libraries, or executable targets, call the generated <primary function
name>_terminate()
housekeeping function.
Examples
Input Arguments
Limitations
MATLAB classes are not supported by the
coder.gpu.persistentMemory
pragma.If the persistent variable in MATLAB is variable-sized, the code generator does not map the variable to a persistent memory on the GPU.
Version History
Introduced in R2020bSee Also
Apps
Functions
codegen
|coder.gpu.kernel
|coder.gpu.kernelfun
|gpucoder.stencilKernel
|coder.gpu.nokernel
|coder.gpu.constantMemory