Hi,
I want to use scatter/ gather operation on MIC. I could not find any example which shows the usage of these operations. I wrote one sample program which scatter an array. if comment "mm512_i32scatter_ps" operation, program is executing with out any problem. if i use "mm512_i32scatter_ps"operation, I am getting error "offload error: process on the device 0 was terminated by signal 11 (SIGSEGV)". Please some help me out.
#include<stdio.h>
#include<stdlib.h>
#include<immintrin.h>
int main()
{
printf("CPU\n");
#pragma offload target(mic)
{
int* a = (int*)_mm_malloc(sizeof(int)*16,64);
for(int i=0; i<16;i++){
a[i] = i;
}
int* index = (int*)_mm_malloc(sizeof(int)*16,64);
for(int i=0; i<16;i++){
index[i] = 15-i;
}
printf("xeonphi\n");
int* b = (int*)_mm_malloc(sizeof(int)*16,64);
__m512i index1 = _mm512_load_epi32((void*)index);
__m512 v1 = _mm512_load_ps((void*)a);
_mm512_i32scatter_ps((void*)b,index1,v1,1);
}
}