Skip to content

[FEA]: Expose get_cuda_native_handle to Python #564

Open
@leofang

Description

@leofang

Is this a duplicate?

Area

cuda.bindings

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

In #463 we added experimental C++ APIs get_cuda_native_handle for C/C++/Cython to access the C handles wrapped by cuda.bindings types/objects. This issue is to track the need of exposing such APIs to Python to replace the current usage of __int__(), something along this line:

from cuda.bindings.utils import get_cuda_native_handle
...

err, s = driver.cuStreamCreate()
s_ptr = get_cuda_native_handle(s)
assert isinstance(s_ptr, int)

We may also consider moving the C++ counterparts from cuda.core to cuda.bindings.

Describe the solution you'd like

n/a

Describe alternatives you've considered

n/a

Additional context

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Medium priority - Should docuda.bindingsEverything related to the cuda.bindings modulefeatureNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions