Re/Coder

知識蓄積備忘録/State-of-the-Ars

cudaDeviceReset cudaDeviceSynchronize

cudaDeviceReset

アプリケーションの最後に呼び出すおまじない.

使用したリソースの解放などを行う.

 

cudaDeviceSynchronize

カーネルの終了を待つ.

 

hello.cuでcudaDeviceSynchronizeを使うとHello World from GPUが表示される理由は,カーネルの処理の終了を待っているからか?

 

参考文献

http://www.gputechconf.jp/content/includes/gtc/redesign/asia/jp/pdf/1070.pdf?v1.0