coder.gpu.constantMemory
Pragma that maps a variable to the constant memory on GPU
Description
coder.gpu.constantMemory(
maps the
variable v
)v
to the constant memory space on the GPU device. Place
this pragma within a parallelizable loop. If GPU Coder™ generates a kernel for the loop, it loads v
to a
device constant memory variable. It replaces any
access to this variable within the kernel by access to the constant memory variable.
Within the kernel, the variable v
must be read-only. Otherwise,
GPU Coder ignores this pragma. Use this pragma when every thread accesses every
element of the parameter array or matrix.
This function is a code generation function. It has no effect in MATLAB®.
Examples
Input Arguments
Version History
Introduced in R2017b
See Also
Apps
Functions
codegen
|coder.gpu.kernel
|coder.gpu.kernelfun
|gpucoder.stencilKernel
|coder.gpu.nokernel
|coder.gpu.persistentMemory