I have two problems in CUDA programming.
I want to pass matrix as a function parameter in a CUDA program. I tried following. GCC compiler compiles the following code but NVIDIA CUDA C compiler does not compiles this code and prompts error. (I have installed CUDA 7.5)
void printMatrix( size_t rows, size_t cols, int a[][cols] )
and
void printMatrix(int row, int col, int matrix[row][col])
Both are not working. It gives "a parameter is not allowed" error.
Inside the main method I want to declare a matrix
int a[n][n];
where n runs from 1 to 5 (in a for loop). It gives "expression must have a constant value" error.
Where am I making the error.
I have tried to compile the code from this question with gcc and nvcc compiler, gcc compiles and nvcc does not.