Main Content

Include error checks in generated code

Include error checks in GPU code at runtime

Since R2020b

Model Configuration Pane: Code Generation / GPU Code


The Include error checks in generated code parameter specifies whether to add run-time error-checking functionality to the generated CUDA® code.


  • This parameter requires a GPU Coder™ license.

  • To enable this parameter, select Generate GPU code on the Code Generation pane.


off (default) | on

Generates code with error-checking for CUDA API and kernel calls and performs run-time checks.


The generated CUDA code does not contain error-checking functionality.

Recommended Settings

DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

Programmatic Use

Parameter: GPUErrorChecks
Type: character vector
Value: 'on' | 'off'
Default: 'off'

Version History

Introduced in R2020b