I am wondering if there is it possible to setup multiple pointers to single data already allocated in memory? the reason i am asking this is because i was implementing lexographical sorting with gpu with the help of thrust vectors (and failed miserably in terms of time)
for example i am trying to acheive equivalent of these c++ statments
unsigned int * pword; //setting up the array of memory for permutations of word
pword = new unsigned int [N*N];
unsigned int* * p_pword; //pointers to permutation words
p_pword = new unsigned int* [N];
//setting up the pointers on the locations such that if N=4 then 0,4,8,12,...
int count;
for(count=0;count<N;count++)
p_pword[count]=&pword[count*N];
I am not asking for someone to provide me with code, i just want to know is there any way i can setup pointers to single array of data. PS: i have tried the following method but not achieving any speedup at all
int * raw_ptr = thrust::raw_pointer_cast(&d_Data[0]); //doing same with multiple pointers
but i guess due to the fact that i am pointing towards device_vector it might be the problem of slow accessing
Any help in this regard is highly appreciated.