I'm new at CUDA and have the following question? My kernel is supposed to calculate a type:
vector <double *> *my_vector = new vector <double *>();
Before I tried to change the original c++ code to cuda it would calculate an array[6] in a loop and then push it back to my_vector.
for{
//calculations
double *array = new double[6];
array[0] = data;
array[1] = data;
array[2] = data;
array[3] = data;
array[4] = data;
array[5] = data;
my_vector->push_back(array);
}
I know that using thrust could help but I prefer if I didn't use it. I thought of using a 2D array at my kernel and copying the data back to my host code and then copying that to my_vector with the std::vector. What I've tried so far has failed.
If anyone has some experience on this and has any idea it would be much help.