How to write a Example C Program Cuda Malloc in C Programming Language ?
Solution For C Program :
int** matrice ;
cudaError_t test = cudaMalloc(&matrice, sizeof(int*)*n);
if test (!= cudaSucces)
return;
for(int k = 0; k < n; k++){
test = cudaMalloc(&matrice[k], sizeof(int)*m);
if (test !=cudaSuccess)
return;
memset(matrice[k], 0, sizeof(int)*m);
}