CreateStream#
Fully qualified name: cupva::cuda::CreateStream
Defined in src/host/cpp_api/include/cupva_host_cuda.hpp
- Stream cupva::cuda::CreateStream(
- cudaStream_t const cudaStream,
- EngineType const absEngine = PVA0,
- AffinityType const vpuAffinity = VPU_ANY,
Create a PVA Stream object from a CUDA stream handle.
- Deprecated:
This function is deprecated. Use cupva::cuda::Submit instead.
To create a Stream using this API, the current Context must have been created after a CUDA context has been loaded. Any CUDA runtime API call will cause a CUDA context to be loaded, as would a CUDA driver API call to
cuCtxCreate()
(see CUDA documentation for more details). The Stream and the cudaStream can be used to submit PVA and CUDA commands respectively, and commands will begin execution in the order they are submitted as if they share the same stream. More specifically, PVA commands will execute following the OrderType specified by the Stream::submit call, while CUDA commands will execute per the configuration of the cudaStream. Synchronization is possible using CUDA APIs (for example,cudaStreamSynchronize()
cudaStreamWaitEvent()
etc.), and/or Fence APIs (CmdWaitOnFences, CmdRequestFences, etc.).The special concept of “CUDA default stream” (cudaStream value of 0) is not supported and the CUDA stream handle must have been explicitly created as a “non blocking” stream (see
cudaStreamCreateWithFlags()
andcuStreamCreate()
in the CUDA API documentation).Usage considerations
Allowed context for the API call
Thread-safe: No
API group
Init: Yes
Runtime: No
De-Init: No
- Parameters:
cudaStream – [in] The CUDA stream handle.
absEngine – [in] The PVA engine ID.
vpuAffinity – [in] The queue submission affinity.
- Throws:
cupva::Exception(InvalidArgument) – The cudaStream value is 0.
cupva::Exception(InvalidArgument) – The AffinityType is invalid.
cupva::Exception(DriverAPIError) – The PVA driver returned an unexpected error.
cupva::Exception(NotAllowedInOperationalState) – if called when NVIDIA DRIVE OS VM state is “Operational”
cupva::Exception(CUDADisabled) – if called after disabling CUDA interop for this process