关于cudaMemcpy()函数关于源和目标指针是否都可以为null [英] about cudaMemcpy() function about whether both the source and destination pointers can be null
本文介绍了关于cudaMemcpy()函数关于源和目标指针是否都可以为null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 cudaMemcpy()
中,源指针和目标指针都可以为null?我是CUDA的初学者。
In cudaMemcpy()
, can the both source and destination pointers be null? I am a beginner in CUDA. so please any help will be appreciated.
推荐答案
这样做是无效的。
传递给 cudaMemcpy
的指针应该是正确分配的指针。 NULL不是正确分配的指针。
The pointers passed to cudaMemcpy
should be properly allocated pointers. NULL is not a properly allocated pointer.
If you do proper CUDA error checking, I think the API will return an error (invalid parameter) with NULL pointers when it is expecting a proper device pointer.
这篇关于关于cudaMemcpy()函数关于源和目标指针是否都可以为null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文