Cuda kernels using pthreads Missing configuration error

What is cuda no error? This code below is a stream function, when I run this code, the received error is 1, which means there is no configuration error. What is the error in this code?

  void* run(void *args)
  {
   cudaError_t error;
   Matrix *matrix=(Matrix*)args;
    int scalar=2;
   dim3 dimGrid(1,1,1);
   dim3 dimBlock(1024,1,1);
   cudaEvent_t  start,stop;
   cudaSetDevice(0);
   cudaEventCreate(&start);
   cudaEventCreate(&stop);
   cudaEventRecord(start,0);
   for(int i=0 ;i< matrix->number ;i++ )
   {
   syntheticKernel<<<dimGrid,dimBlock>>>();
   cudaThreadSynchronize();
   }
   cudaEventRecord(stop,0);
   cudaEventSynchronize(stop);
   cudaEventElapsedTime(&matrix->time,start,stop);
   error=cudaGetLastError();
   assert(error!=0);
   printf("%d\n",error);
  }
0
source share
2 answers

Can you add more details about your program, please? Each CUDA API returns a status code, you must check the status of each API call to catch and decode the first error reported.

, , - API CUDA , pthreads. CUDA ( , , API CUDA), , . , , API.

+3

? :

dim3 dimGrid(1,1,1);
dim3 dimBlock(1024,1,1);

. , , , , .

0

Source: https://habr.com/ru/post/1535650/


All Articles