Skip to content

[FEA]: Autodetect __cuda_array_interface__ for launching kernels #1435

@desplenterkarel

Description

@desplenterkarel

Is this a duplicate?

Area

cuda.pathfinder

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

When researching how to launch kernels in python i came to the problem that unlike cupy, CUDA python needs .data.ptr or .data_ptr depending if its a cupy array or a pytorch tensor.

This came up in de discussion of a cupy kernel launch problem.
cupy#9576

Describe the solution you'd like

The __cuda_array_interface__ already has the specification that data key returns the pointer.

So the question is if we can leverage this and make the passing of array/tensors more pythonic (like for ints and so on).
By getting the pointer automatically if the interface is part of the object?

Describe alternatives you've considered

Alternatively we could just standardize either .data.ptr or .data_ptr. But as its already part or a standard interface this seams to be redundant.
But if here are other ideas or ways to achieve the same goal my very happy to hear them.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageNeeds the team's attention

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions