8.5.1. Dynamic Dispatch - 8.5.1. Dynamic Dispatch - 5.3 English - 57404

AOCL User Guide (57404)

Document_ID
57404
Release_Date
2026-05-13
Version
5.3 English

AOCL-DLP automatically selects the best kernel for your CPU based on available instruction sets. However, you can override this behavior for testing or specific optimization scenarios.

Architecture Control:

The AOCL_ENABLE_INSTRUCTIONS environment variable forces specific instruction sets, overriding auto-detection:

# Force AVX512 instructions on Zen4 processors
export AOCL_ENABLE_INSTRUCTIONS=avx512
./your_application

# Use Zen3-optimized kernels
export AOCL_ENABLE_INSTRUCTIONS=zen3
./your_application

Supported Values (case-insensitive):

Value

Description

zen5

Zen 5 architecture optimizations (AVX512_FP16)

zen4

Zen 4 architecture optimizations (AVX512_BF16, VNNI)

zen3

Zen 3 architecture optimizations

zen2

Zen 2 architecture optimizations

zen

Zen 1 architecture optimizations

avx512

AVX-512 instruction set

avx512_ymm

AVX-512 using 256-bit YMM registers (f32 only)

avx2

AVX2 instruction set

avx

AVX instruction set

sse4_2

SSE 4.2 instruction set

sse4_1

SSE 4.1 instruction set

sse4a

SSE 4a instruction set

ssse3

Supplemental SSE3 instruction set

sse3

SSE3 instruction set

sse2

SSE2 instruction set

Note

avx512_ymm is only applicable for float32 (f32) datatypes. It forces the use of 256-bit YMM registers on AVX512-capable architectures, which can be beneficial in certain scenarios. Other datatypes (bf16, int8) use the default AVX512 implementation regardless of this setting.

Optimization Strategies:

  1. Choose Appropriate Data Types: Use lower precision (bf16, int8) when accuracy permits

  2. Enable Matrix Reordering: Reorder frequently used matrices for better cache performance

  3. Utilize Post-Operations: Fuse operations to reduce memory bandwidth

  4. Minimize Operations: Use matrix reordering beforehand so that DLP has to do fewer operations

  5. Align Memory: Ensure proper memory alignment for vector instructions