Specify the memory allocation (malloc) mode to use in the generated
CUDA® code.
Category: Code Generation > GPU Code
Default:
discrete
discreteThe generated code uses the cudaMalloc API for transferring
data between the CPU and the GPU. From the programmers point-of-view, the discrete
mode has a traditional memory architecture with separate CPU and GPU global memory
address space.
unifiedThe generated code uses the cudaMallocManaged API that uses a
shared (unified) CPU and GPU global memory address space.
For NVIDIA® embedded targets only. See Deprecating support for unified memory allocation mode on host (GPU Coder).
This parameter requires a GPU Coder™ license.
To enable this parameter, select Generate GPU code on the Code Generation pane.
Parameter:
GPUMallocMode |
| Type: character vector |
Value:
'discrete' | 'unified' |
Default:
'discrete' |
unified memory allocation mode on hostIn a future release, support for the unified memory allocation
(cudaMallocManaged) mode will be removed when targeting NVIDIA GPU devices on the host development computer. When targeting GPU devices on
the host, select 'discrete' for the Memory
mode parameter.
You can continue to use unified memory allocation mode when targeting NVIDIA embedded platforms.