Darknet: ‘cudaThreadSynchronize’ is deprecated

Created on 26 Sep 2018  Â·  1Comment  Â·  Source: pjreddie/darknet

./src/gemm.c: In function ‘time_gpu’:
./src/gemm.c:232:9: warning: ‘cudaThreadSynchronize’ is deprecated [-Wdeprecated-declarations]
         cudaThreadSynchronize();
         ^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/cuda/include/cuda_runtime.h:96:0,
                 from include/darknet.h:11,
                 from ./src/utils.h:5,
                 from ./src/gemm.c:2:
/usr/local/cuda/include/cuda_runtime_api.h:947:57: note: declared here
 extern __CUDA_DEPRECATED __host__ cudaError_t CUDARTAPI cudaThreadSynchronize(void);
                                                         ^~~~~~~~~~~~~~~~~~~~~

Deprecation is the path to obsolescence. Deprecation leads to removal. Removal leads to build failures. Build failures lead to suffering.

Env:

  • Ubuntu 18.04
  • CUDA 10.0
  • cudNN 7.3.0

Most helpful comment

Just replace at /src/gemm.c:232: cudaThreadSynchronize() with cudaDeviceSynchronize()
See:
https://stackoverflow.com/questions/13485018/cudastreamsynchronize-vs-cudadevicesynchronize-vs-cudathreadsynchronize

>All comments

Just replace at /src/gemm.c:232: cudaThreadSynchronize() with cudaDeviceSynchronize()
See:
https://stackoverflow.com/questions/13485018/cudastreamsynchronize-vs-cudadevicesynchronize-vs-cudathreadsynchronize

Was this page helpful?
0 / 5 - 0 ratings