I’m working on a problem where I need to make a lot of permutations on a lot of vectors, for random permutation t-test, how should this be implemented in CUDA?
My vectors are for example of the length 100 samples and I want to do 10 000 permutations (and t-tests) on each vector.
while (i > 1) { // While at least 2 left to shuffle
unif ( &irand , &frand ) ;
j = (int) (frand * i) ;
if (j >= i) // This is necessary only for FLOAT math. DOUBLE guarantees j < i.
j = i - 1 ;
--i ;
itemp = indices[i] ;
indices[i] = indices[j] ;
indices[j] = itemp ;
}
}
}
I’m sorry that the formatting here destroys the indentation.