I am relatively new to CUDA. I wrote a kernel that I am including in one of my C++ projects.
I think the kernel is well implemented, however when I try to compile the project, I get the following error message:
error C2065: ‘threadIdx’ : undeclared identifier
error C2228: left of ‘.x’ must have class/struct/union
Yes, I wrote my kernel in a .cu file (matvecmult_kernel.cu)
did you use nvcc to compile the .cu file?
I am not sure about that … I include a new Build Rule which identifies the
.cu file, and I think that in this rule, the command argument nvcc … is
already specified.
// Multiplicacion matriz por vector A * x = res
void Mult(const double* gval_, const int* gcolind_, const int* growptr_, const int nrow, const int ncol,
const int nnzero, const double* gx_, double* res_)
{
int size_a, size_a2, size_b, size_b2, size_c;
// Load SparseMatrix “A” and vectors “x” and “res” to the device
// Note: Subscript _d identifies a device variable !!
// Multiplicacion matriz por vector A * x = res
void Mult(const double* gval_, const int* gcolind_, const int* growptr_, const int nrow, const int ncol,
const int nnzero, const double* gx_, double* res_)
{
int size_a, size_a2, size_b, size_b2, size_c;
// Load SparseMatrix “A” and vectors “x” and “res” to the device
// Note: Subscript _d identifies a device variable !!