I am trying to print out the value of an __m256i
variable but I get a run-time error (file.exe has stopped working!). My CPU is Intel and supports AVX instructions. When I comment the cout line, the code runs. I am using Intel C++ compiler. what is the problem? Is there any other way to show the contents of __m256i
variable. My code is as follows:
#include <iostream>
#include <iomanip>
#include "immintrin.h"
using namespace std;
int main()
{
__m256i a;
int i;
a = _mm256_set_epi64x(1, 2, 3, 4);
cout << setfill('0'); // fill with 0s
for (i = 0; i < 4; i++) {
cout << hex << setw(16) << _mm256_extract_epi64(a, i);
}
cout << endl;
cin.get();
return 0;
}