CPUID AVX-512F

CPUID AVX-512F

The latest release of SDE appears to allow support of AVX-512 instructions. However, I seem to be having trouble querying the processor support of AVX-512 Foundation instructions via CPUID through SDE. AVX2 appears to work correctly, some sample code (32-bit):

#include <iostream>

using namespace std;

int main() {
  int R_ebx;

  __asm {
    mov eax, 7
    mov ecx, 0
    cpuid
    mov R_ebx, ebx
  }

  const int AVX2 = 1<<5;
  const int AVX512F = 1<<16;

  cout << "AVX2: " << ((AVX2 & R_ebx) > 0) << endl;
  cout << "AVX512F: " << ((AVX512F & R_ebx) > 0) << endl;
}

Output:

AVX2: 1
AVX512F: 0

This sample code is based off of the AVX Intel documentation revision 15 located here: http://software.intel.com/sites/default/files/319433-015.pdf. Chapter 2.1 states: 

Processor support of AVX-512 Foundation instructions is indicated by CPUID.(EAX=07H, ECX=0):EBX.AVX512F[bit
16] = 1.

Is there a particular setting I need to enable for SDE to turn on AVX-512?

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Best Reply

Hi, Yes, pleas use "-knl" when you want to access the AVX512-related features.

Leave a Comment

Please sign in to add a comment. Not a member? Join today