The following table lists the CMake variable used to enable ISA-specific optimizations for AMD processors.
CMake Variable or Option
|
Usage
|
|---|---|
AMD_CONFIG
|
-DAMD_CONFIG=<value> to enable architecture-specificoptimizations. Supported values:
zen, zen2, zen3,zen4, zen5, amdzen. If not specified (empty), defaultsto
amdzen for generic AMD builds. |
AMD_CONFIG Impact on Libraries
AOCL-BLAS (BLIS): Maps directly to
BLIS_CONFIG_FAMILYconfiguration.AOCL-LAPACK (LibFlame)
zen,zen2,zen3→ AVX2-STRICT optimizationszen4,zen5→ AVX512-STRICT optimizationsDefault: AVX2
AOCL-LibM
zen→ Static dispatch with AVX2zen2→ Static dispatch with ZEN2zen3→ Static dispatch with ZEN3zen4→ Static dispatch with ZEN4zen5→ Static dispatch with ZEN5Default: Dynamic dispatch (runtime detection)
AOCL-DA
zen,zen2→znver2zen3→znver3zen4→znver4zen5→znver5amdzen→dynamicDefault:
dynamic
AOCL-Sparse
zen,zen2,zen3→OFF(AVX512 code paths disabled at build time)zen4,zen5,amdzen→ON(AVX512 code paths enabled at build time)Default:
ONRuntime 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