Wednesday, December 17, 2014

How to check Intel AVX2 support on Mac OS X

If you wanted to check whether your Intel CPU included support for Intel AVX1 (short for Intel Advanced Vector eXtensions), also known as AVX1.0, you could execute the following command on a Terminal window:

sysctl -a | grep machdep.cpu.features

However, if you execute the command on a MacBook Pro running OS X Yosemite Version 10.10.1, with an Intel Core i5-4278U, you will notice only AVX1.0 is listed in the features list:

machdep.cpu.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM PBE SSE3 PCLMULQDQ DTES64 MON DSCPL VMX EST TM2 SSSE3 FMA CX16 TPR PDCM SSE4.1 SSE4.2 x2APIC MOVBE POPCNT AES PCID XSAVE OSXSAVE SEGLIM64 TSCTMR AVX1.0 RDRAND F16C



You can check the official specs for an Intel Core i5-4278U CPU here, and you will notice the CPU provides AVX2 (indicated as AVX 2.0, and also known as Haswell New Instructions).

You have to run the following command on a Terminal window to check whether AVX2 is listed:


sysctl -a | grep machdep.cpu.leaf7_features

The results of executing this command in the configuration I mentioned before is the following:

machdep.cpu.leaf7_features: SMEP ERMS RDWRFSGS TSC_THREAD_OFFSET BMI1 AVX2 BMI2 INVPCID



As you can notice, the results include AVX2, and therefore, the configuration includes support for Intel AVX2 and you can use the necessary compiler options to generate code that takes advantage of this powerful instruction set.

No comments:

Post a Comment