我有一些简单的测试代码,我试图在Linux Redhat 5.6上使用icc v12.1生成AVX优化代码。代码如下所示:
int main() {
double sum = 0.0;
for (unsigned int i = 0; i < 1024; i++) {
sum += static_cast<double>(i);
}
std::cout << "Sum: "<< sum << std::endl;
return 0;
}
我编译它(并且矢量报告说循环被矢量化):
icc -xavx -vec-report1 main.cpp
当我运行代码时,我收到以下错误:
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) AVX.
我确信该处理器具有AVX功能,但其他人是否在Redhat 5.6上遇到AVX问题?