The docs for vDSP_vgathr
say it's defined as
void vDSP_vgathr (
float *__vDSP_A,
vDSP_Length *__vDSP_B,
vDSP_Stride __vDSP_J,
float *__vDSP_C,
vDSP_Stride __vDSP_K,
vDSP_Length __vDSP_N
);
You're passing an int into that function and vDSP_Length
is defined as unsigned long.
So, pass an unsigned long in:
unsigned long * idxSend = (unsigned long *)malloc(sizeof(unsigned long) * N);
for (i=0; i<N; i++) idxSend[i] = (unsigned long)idx[i];
vDSP_vgathr(..., idxSend, ...);
That solves your problem.