Skip to content

[FEA]: Support CUDA Stream protocol in Stream related classes #1222

@tqchen

Description

@tqchen

Is this a duplicate?

Area

cuda.bindings

Is your feature request related to a problem? Please describe.

CUDA stream protocol can help libraries to interact with raw cuda streams in a natural way, for example, a framework can check hasattr(stream, "__cuda_stream__") then fetch the returned stream and pass to arguments that needs stream in places like DLPack.

The nice thing about such pattern is the downstream package do not need explicitly do isinstance(stream, StreamClass) and also do not need to introduce explicit dep to related stream classes.

It would be nice for cuda-python stream classes to implement CUDA stream protocol

Describe the solution you'd like

  • cuda.bindings.driver.CUstream support CUDA stream protocol

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    cuda.bindingsEverything related to the cuda.bindings moduletriageNeeds the team's attention

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions