cudaStreamSynchronize vs CudaDeviceSynchronize vs cudaThreadSynchronize CUDA中的屏障同步
2015-03-04 18:43
1641 查看
cudaStreamSynchronize
vs CudaDeviceSynchronize vs cudaThreadSynchronize
These are all barriers. Barriers prevent code execution beyond the barrier until some condition is met.cudaDeviceSynchronize() halts
execution in the CPU/host thread (that the cudaDeviceSynchronize was issued in) until the GPU has finished processing all previously requested cuda tasks (kernels, data copies, etc.)
cudaThreadSynchronize() as
you've discovered, is just a deprecated version of
cudaDeviceSynchronize.
Deprecated just means that it still works for now, but it's recommended not to use it (use cudaDeviceSynchronize instead) and in the future, it may become unsupported. But
cudaThreadSynchronize()
and
cudaDeviceSynchronize()
are basically identical.
cudaStreamSynchronize() is
similar to the above two functions, but it prevents further execution in the CPU host thread until the GPU has finished processing all previously requested cuda tasks that
were issued in the referenced stream. So
cudaStreamSynchronize()
takes a stream id as it's only parameter. cuda tasks issued in other streams may or may not be complete when CPU code execution continues beyond this barrier.
相关文章推荐
- CudaDeviceSynchronize vs cudaThreadSynchronize vs cudaStreamSynchronize
- cudaStreamSynchronize vs cudaDeviceSynchronize vs cudaThreadSynchronize
- CudaDeviceSynchronize vs cudaThreadSynchronize vs cudaStreamSynchronize
- 【JavaSE学习笔记】多线程01_Thread,Runnable,synchronize同步机制
- cudaDeviceSynchronize的优化
- Synchronized vs Concurrent Collections(并发集合VS同步集合)
- cuda的block thread wrap 同步与数据处理
- Check failed: error == cudaSuccess (8 vs. 0) invalid device function
- Spring应用中的ThreadLocal VS synchronized
- CUDA/caffe ERROR:cudaGetDeviceCount returned 30/35,Check failed: error == cudaSuccess (30/35 vs. 0)
- 【CUDA开发】 Check failed: error == cudaSuccess (8 vs. 0) invalid device function
- Check failed: error == cudaSuccess (8 vs. 0) invalid device function
- Synchronized vs Concurrent Collections(并发集合VS同步集合)
- 关于何时使用cudaDeviceSynchronize
- cuda的block thread wrap 同步与数据处理
- 关于何时使用cudaDeviceSynchronize
- Could not obtain transaction-synchronized Session for current thread -无法获取当前线程的事务同步会话-解决方案
- vs打开项目出错:未找到导入的项目“C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.0.props”的解决办法
- Object sharing for Runnable vs. extends Thread
- Java --- Thread VS Process