Reputation: 31
In cudaMemcpy()
, can the both source and destination pointers be null? I am a beginner in CUDA. so please any help will be appreciated.
Upvotes: 0
Views: 266
Reputation: 152249
It is not valid to do so.
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.
Upvotes: 5