Main Content

Generate Halide code

Generate Halide code for faster array computation

Since R2023b

Model Configuration Pane: Code Generation


The Generate Halide code parameter instructs the code generator to generate Halide code. If there are no opportunities for Halide code generation, Embedded Coder® will generate plain C/C++ code.


To enable this parameter:

  • Install Embedded Coder.

  • Set System target file to an ERT-based system target file.

  • Set Array layout to Column-major.

  • Disable Generate GPU code.

  • Set Code replacement libraries to None.

  • If the Language is set to C, then set Hardware board to None.

  • If the Language is set to C++, then set Hardware board to one of these settings:

    • Android Device

    • Android Device (64bit)

    • Raspberry Pi

    • Raspberry Pi (64bit)

    • Raspberry Pi - Robot Operating System (ROS)

    • None


off (default) | on

Generates Halide code.


Does not generate Halide code.

Recommended Settings

DebuggingNo recommendation
TraceabilityNo recommendation
Safety precautionNo recommendation

Programmatic Use

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

Version History

Introduced in R2023b