Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert cudaStream_t object to CUStream object

Tags:

cuda

jcuda

Is there any way to convert cudaStream_t object to CUStream?

I found this hack but I don't think its safe to use. Or, is there any way to call cudaLaunchKernel in JCuda application using cudaStream_t object in CUDA 7.5 only?

like image 511
sandeep.ganage Avatar asked Sep 13 '25 20:09

sandeep.ganage


1 Answers

At a C level within the runtime and driver APIs, cudaStream_t and CUStream are the same type and can be used interchangeably in either API.

At a JCUDA level, it appears that CUstream has a specialization of its constructor for initializing an instance with an existing cudaStream_t instance. The provision of this alternative constructor eliminates the need for the pointer swap you linked to in the question.

like image 199
2 revstalonmies Avatar answered Sep 15 '25 10:09

2 revstalonmies