Intel® oneAPI DPC++/C++ Compiler
Developer Guide and Reference
cpu_dispatch, cpu_specific
Provides the ability to write one or more versions of a function that execute only on a list of targeted processors (cpu_dispatch). Provides the ability to declare that a version of a function is targeted at particular types of processors (cpu_specific).
Syntax
Windows: __declspec(cpu_dispatch(cpuid, cpuid, ...)) __declspec(cpu_specific(cpuid)) |
Linux: __attribute__((cpu_dispatch(cpuid, cpuid, ...))) __attribute__((cpu_specific(cpuid))) |
Arguments
cpuid |
Possible values are: arrowlake_s: Intel® Core™ Ultra processors (formerly known as Arrow Lake) atom: Intel® Atom™ processors with Intel® Supplemental Streaming SIMD Extensions 3 (Intel® SSSE3) atom_sse4_2: Intel® Atom™ processors with Intel® Streaming SIMD Extensions 4.2 (Intel® SSE4.2) atom_sse4_2_movbe: Intel® Atom™ processors with Intel® Streaming SIMD Extensions 4.2 (Intel® SSE4.2) with MOVBE instructions enabled broadwell: This is a synonym for core_5th_gen_avx common_avx512: Intel® processors that support Intel® Advanced Vector Extensions 512 (Intel® AVX-512) core_2_duo_sse3: Intel® Core™ 2 Duo processors with Intel® Streaming SIMD Extensions 3 (Intel® SSE3) instructions core_2_duo_sse4_1: Intel® Core™ 2 Duo processors with Intel® Streaming SIMD Extensions 4.1 (Intel® SSE4.1) instructions core_2nd_gen_avx: 2nd generation Intel® Core™ processor family with support for Intel® Advanced Vector Extensions (Intel® AVX) core_3rd_gen_avx: 3rd generation Intel® Core™ processor family with support for Intel® Advanced Vector Extensions (Intel® AVX) including the RDRND instruction core_4th_gen_avx: 4th generation Intel® Core™ processor family with support for Intel® Advanced Vector Extensions 2 (Intel® AVX2) including the RDRND instruction core_4th_gen_avx_tsx: 4th generation Intel® Core™ processor family with support for Intel® Advanced Vector Extensions 2 (Intel® AVX2) including the RDRND instruction, and support for Intel® Transactional Synchronization Extensions (Intel® TSX) core_5th_gen_avx: 5th generation Intel® Core™ processor family with support for Intel® Advanced Vector Extensions 2 (Intel® AVX2) including the RDSEED and Multi-Precision Add-Carry Instruction Extensions (ADX) instructions core_5th_gen_avx_tsx: 5th generation Intel® Core™ processor family with support for Intel® Advanced Vector Extensions 2 (Intel® AVX2) including the RDSEED and Multi-Precision Add-Carry Instruction Extensions (ADX) instructions, and support for Intel® Transactional Synchronization Extensions (Intel® TSX) core_aes_pclmulqdq: Intel® Core™ processors with support for Advanced Encryption Standard (AES) instructions and carry-less multiplication instruction core_i7_sse4_2: Intel® Core™ i7 processors with Intel® Streaming SIMD Extensions 4.2 (Intel® SSE4.2) instructions generic: Other Intel processors for Intel® 64 architecture or compatible processors not provided by Intel Corporation goldmont_plus: Intel® Atom™ processors with Goldmont Plus architecture graniterapids_d: Intel® Xeon® 6 processors (formerly known as Granite Rapids) haswell: This is a synonym for core_4th_gen_avx icelake_client: 10th generation Intel® processors (formerly known as Ice Lake) icelake_server: 3rd generation Intel® Xeon® scalable server processors (formerly known as Ice Lake) knl: Intel® Xeon Phi™ x200 processors (formerly known as Knights Landing) knm: Intel® Xeon Phi™ 72x5 processors (formerly known as Knights Mill) mic_avx512: This is a synonym for knl pentium: Intel® Pentium® processor pentium_4: Intel® Pentium® 4 processors pentium_4_sse3: Intel® Pentium® 4 processor with Intel® Streaming SIMD Extensions 3 (Intel® SSE3) instructions, Intel® Core™ Duo processors, Intel® Core™ Solo processors pentium_ii: Intel® Pentium® II processors pentium_iii: Intel® Pentium® III processors pentium_iii_no_xmm_regs: Intel® Pentium® III processors with no XMM registers pentium_m: Intel® Pentium® M processors pentium_mmx: Intel® Pentium® processors with MMX™ technology pentium_pro: Intel® Pentium® Pro processors skylake_avx512: Intel® Xeon® Processor E3 v5 Family (formerly known as Skylake) processors with Intel® Advanced Vector Extensions 512 (Intel® AVX-512) |
Description
Use the cpu_dispatch keyword to provide a list of targeted processors, along with an empty function body/function stub.
Use the cpu_specific keyword to declare each function version targeted at particular type of processor.
These features are available for Intel processors based on Intel® 64 architecture. They may not be available for non-Intel processors. If your non-Intel processor is not supported, you will get a "invalid option" error at compile-time.
Applications built using the manual processor dispatch feature may be more highly optimized for Intel processors than for non-Intel processors.