no5-aaron-wu / no5-aaron-wu.github.io

aaron-wu的个人博客
0 stars 0 forks source link

CUDA基础 [5]:互斥锁设计 | 旭穹の陋室 #21

Open no5-aaron-wu opened 2 years ago

no5-aaron-wu commented 2 years ago

https://no5-aaron-wu.github.io/2021/11/30/CUDA-5-mutexLock/

初版 流传甚广的版本,来自《GPU高性能编程CUDA实战》中的sample class CudaKernelLock {private: int* mutex;public: CudaKernelLock(void) { int state = 0; cudaError_t ret = cudaMalloc((void**)&