At this simple code, I am passing an array of __m256i to a function, and making it new there. However, it has this error :
EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
My code:
#include <iostream>
#include <immintrin.h>
void fun(__m256i **x){
*x = new __m256i [10];
(*x)[0] = _mm256_setr_epi64x(1, 2, 3, 4); -----> Error is here
}
int main() {
__m256i *x;
fun(&x);
return 0;
}
Any help will be greatly appreciated.