I'm writing my first CUDA program and encounter a lot of issues, as my main programming language is not C++.
In my console app I have a vector
of int
that holds a constant list of numbers. My code should create new vectors and check matches with the original constant vector.
I don't know how to pass / copy pointers of a vector into the GPU device. I get this error message after I tries to convert my code from C# into C++ and work with the Kernel:
"Error calling a host function("std::vector<int, ::std::allocator > ::vector()") from a global function("MagicSeedCUDA::bigCUDAJob") is not allowed"
This is part of my code:
std::vector<int> selectedList;
FillA1(A1, "0152793281263155465283127699107744880041");
selectedList = A1;
bigCUDAJob<< <640, 640, 640>> >(i, j, selectedList);
__global__ void bigCUDAJob(int i, int j, std::vector<int> selectedList)
{
std::vector<int> tempList;
// here comes code that adds numbers to tempList
// code to find matches between tempList and the
// parameter selectedList
}
How to modify my code so I won't get compiler errors? I can work with array of int as well.