Generate GPU code
Enable code generation for GPUs
Model Configuration Pane: Code Generation
Description
The Generate GPU code parameter specifies whether to use GPU Coder™ and generate CUDA® code.
Dependencies
- This parameter requires a GPU Coder license. 
- To enable this parameter, select - C++for the Language and- grt.tlcor- ert.tlcfor System target file.
- Enabling Generate GPU code selects Support long long and Support long long parameters on the Hardware Implementation pane. 
- For an GRT-based system target file, enabling Generate GPU code changes the following parameters on the Code Generation > Optimization pane: - Selects - Nonefor Leverage target hardware instruction set extensions.
 
- For an ERT-based system target file, enabling Generate GPU code changes the following parameters on the Code Generation > Optimization pane: - Disables Generate parallel for-loops (Embedded Coder). 
- Selects - <empty>for Disable incompatible optimizations.
 
- For an ERT-based system target file, enabling Generate GPU code selects Terminate function required (Embedded Coder) parameter on the Code Generation > Interface pane. 
Settings
 On On
- Enables code generation by using GPU Coder. 
 Off Off
- Disables code generation by using GPU Coder. 
Recommended Settings
| Application | Setting | 
|---|---|
| Debugging | No impact | 
| Traceability | No impact | 
| Efficiency | No impact | 
| Safety precaution | No impact | 
Programmatic Use
| Parameter: GenerateGPUCode | 
| Type: character vector | 
| Value: 'CUDA'|'none' | 
| Default: 'none' | 
Version History
Introduced in R2020b