我有配置:Intel(R)Core(TM)i7-4702MQ CPU(具有Haswell架構),Windows 8,Intel C++ Compiller XE 13.0。 我想運行我的AVX2優化方案,並把編譯標誌:如何驗證操作系統是否支持avx2指令
/QaxCORE-AVX2, /QxCORE-AVX2
但是當我運行該程序,我得到錯誤:
Fatal Error: This program was not built to run in your system. Please verify that both the operating system and the processor support Intel(R) AVX2, BMI, LZCNT, HLE, RTM, and FMA instructions.
我跑這頁上給出AVX2 CPU支持測試: How to detect new instruction support in the 4th generation Intel Core processor family。 結果:
This CPU supports ISA extensions introduced in Haswell.
我如何檢查我的操作系統支持AVX2擴展,而這可能是錯誤的原因是什麼?對於使用avx2擴展我需要設置/QaxCORE-AVX2
和/QxCORE-AVX2
標誌?
UPD:如果我設置標誌
/QxAVX
該程序已成功啓動。
也許XSAVE被禁用。我不知道如何啓用它,但它可能是一個啓動配置。 – Mysticial 2014-09-13 06:41:57
@Mysticial我用函數IsProcessorFeaturePresent(PF_XSAVE_ENABLED)創建簡單的win32項目。這個函數返回True。 – 2014-09-13 07:20:35
檢查什麼時候?在編譯時?在運行時?無論如何,這更像是一個與市場相關的問題,例如2955U是賽揚正式基於Haswell架構的產品,但它甚至不提供第一代AVX。 – user2485710 2014-09-13 17:52:26