Main Content

GPU device ID

CUDA device selection

Description

App Configuration Pane: GPU Code

Configuration Objects: coder.gpuConfig

The GPU device ID parameter specifies the CUDA® device ID for the generated code to target in environments that have multiple GPUs, such as NVIDIA DRIVE® platforms.

The GPU device ID parameter only affects standalone code. Generated MEX functions do not use the device ID specified by this parameter and use the GPU connected to MATLAB® instead.

Settings

-1

This setting is the default setting. Targets the default device.

0 | positive integer

Targets the device with the specified positive integer or zero ID.

Programmatic Use

Property: SelectCudaDevice
Values: -1 | 0 | positive integer
Default: -1

Version History

Introduced in R2018b