由于发现cuda c++ 的 debug方式和c++ 差别很大,因此打算再开一篇,专门记录一些和error checking 以及debug有关的内容.
Error checks in CUDA code can help catch CUDA errors at their source. There are 2 sources of errors in CUDA source code:
update:有毒吧,kernel 中出问题原来不会报错。
请教了组里的 hust 学长 orz..
学到了 cuda-memcheck 命令和 cudaGetLastError 来查看问题,可以参考What is the canonical way to check for errors using the CUDA runtime API?
先放一波资料。
An Even Easier Introduction to CUDA CUDA C/C++ Basics nvidia-thrust 官方文档 how-access-global-memory-efficiently-cuda-c-kernels efficient-matrix-transpose-cuda-cc 很强大的warp内shuffle cuda-GDB官方文档 cuda-c-best-practices-guide cuda 提出的目的是能够让程序员透明地使用GPU来高效地进行并行运算。