0

Consider the CUDA API function

CUresult cuMemcpy3DAsync (const CUDA_MEMCPY3D* pCopy, CUstream hStream);

described here.

It takes a CUDA_MEMCPY3D structure by pointer ; and this pointer is not to some CUDA-driver-created entity - it's to a structure the user has created.

My question: Do we need to keep the pointed-to structure alive past the call to this function returning? e.g. until after we've sycnrhonized the stream we've enqueued the copy on? Or - can we just discard it immediately? I'm guessing it should be the former, but the documentation doesn't really say.

einpoklum
  • 118,144
  • 57
  • 340
  • 684
  • cuMemcpy3DAsync isn't a graph API function. It has been part of the vanilla driver API since CUDA was originally released – talonmies Feb 08 '23 at 05:54
  • @talonmies: You're right, I initially asked this question about the `cuGraphAddMemcpyNode()` function, then noticed it was the same for just `cuMemcpy3DAsync()` itself, and forgot to edit that word out in the rewrite. – einpoklum Feb 08 '23 at 16:35
  • @paleonix: Removed it. – einpoklum Feb 08 '23 at 19:29

0 Answers0