19.7.3. CMake Options for AMD Architecture-Specific Optimizations - 19.7.3. CMake Options for AMD Architecture-Specific Optimizations - 5.3 English - 57404

AOCL User Guide (57404)

Document ID
57404
Release Date
2026-05-13
Version
5.3 English

The following table lists the CMake variable used to enable ISA-specific optimizations for AMD processors.

Table 19.3 CMake Variables for AMD Architecture-Specific Optimizations#
CMake Variable or Option
Usage
AMD_CONFIG
-DAMD_CONFIG=<value> to enable architecture-specific
optimizations. Supported values: zen, zen2, zen3,
zen4, zen5, amdzen. If not specified (empty), defaults
to amdzen for generic AMD builds.

AMD_CONFIG Impact on Libraries

  • AOCL-BLAS (BLIS): Maps directly to BLIS_CONFIG_FAMILY configuration.

  • AOCL-LAPACK (LibFlame)

    • zen, zen2, zen3 → AVX2-STRICT optimizations

    • zen4, zen5 → AVX512-STRICT optimizations

    • Default: AVX2

  • AOCL-LibM

    • zen → Static dispatch with AVX2

    • zen2 → Static dispatch with ZEN2

    • zen3 → Static dispatch with ZEN3

    • zen4 → Static dispatch with ZEN4

    • zen5 → Static dispatch with ZEN5

    • Default: Dynamic dispatch (runtime detection)

  • AOCL-DA

    • zen, zen2znver2

    • zen3znver3

    • zen4znver4

    • zen5znver5

    • amdzendynamic

    • Default: dynamic

  • AOCL-Sparse

    • zen, zen2, zen3OFF (AVX512 code paths disabled at build time)

    • zen4, zen5, amdzenON (AVX512 code paths enabled at build time)

    • Default: ON

    • Runtime dispatch remains automatic and can be guided using AOCL_ENABLE_INSTRUCTIONS

Examples

# Build with Zen 4 optimizations (AVX512 for LAPACK and LibM)
$ cmake --preset aocl-linux-make-lp-ga-gcc-config -DAMD_CONFIG=zen4 --fresh

# Build with Zen 2 optimizations (AVX2 for LAPACK, static dispatch for LibM)
$ cmake --preset aocl-linux-make-lp-ga-gcc-config -DAMD_CONFIG=zen2 --fresh

# Build with generic AMD optimizations (dynamic dispatch)
$ cmake --preset aocl-linux-make-lp-ga-gcc-config -DAMD_CONFIG=amdzen --fresh