I’d like to obtain the underlying cudaStream_t pointer from torch.cuda.Stream().cuda_stream in python, then pass such obtained pointer into my cpp code which does not depend on torch. I’d like to use such pointer to call cudaStreamSynchronize(ptr).
Is this possible and safe to use like this? just reinterpret_cast<cudaStream_t>(torch.cuda.Stream().cuda_stream).
@ptrblck
As stream, I think the same equivalence is applied to torch.cuda.Event().cuda_event and cudaEvent_t as well. Right? just create pointer via cuda_event = torch.cuda.Event()._cuda_event ctypes.c_void_p(cuda_event).
hi,
I want to pass torch.cuda.Stream() to my cpp code and use it as c10::cuda::CUDAStream but failed.
Whether there are some APIs that can do this? Hope for your reply.