# 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* OS: __declspec(cpu_dispatch(cpuid, cpuid, ...)) __declspec(cpu_specific(cpuid))

Linux* OS: __attribute__((cpu_dispatch(cpuid, cpuid, ...))) __attribute__((cpu_specific(cpuid)))

## Arguments

`cpuid` | Possible values are: 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 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 IA-32 (for C++ only) or Intel® 64 architecture or compatible processors not provided by Intel Corporation haswell: This is a synonym for core_4th_gen_avx 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

## 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 only for Intel processors based on IA-32 (for C++ only) or Intel® 64 architecture. They are not available for non-Intel processors. Applications built using the manual processor dispatch feature may be more highly optimized for Intel processors than for non-Intel processors.

Parent topic: Attributes

## See Also

Processor Targeting