Skip to content

Feature Request: create SyclDevice and attribute to and from dlpack Enum in Python #1929

Closed

Description

@icfaust

There is already functionality for converting SyclDevices into dlpack_device Enums (c_dlpack.get_parent_device_ordinal_id) occurring in Cython. dpctl Tensors also already include a __dlpack_device__, would it be possible to enhance operability with dlpack by including a __dlpack_device__ attribute to SyclDevice, and make a SyclDevice creator arg if passed a dlpack enum?

Thanks

Activity

  1. self-assigned this
    on Dec 10, 2024
  2. ndgrigorian commented on Jan 2, 2025

    @ndgrigorian
    Collaborator

    I've started work on this feature. Would it be sufficient for your needs for dpctl.tensor to expose two functions for interchanging a DLPack device with a SyclDevice or a dpctl.tensor.Device?

    Something like

    import dpctl.tensor as dpt
    
    dev = dpctl.SyclDevice("*:cpu")
    dlpack_dev = dpt.create_dlpack_device(dev)

    and its converse (making a root SyclDevice from a DLPack device type).

    This avoids creating a dependency between dpctl.SyclDevice and DLPack functionality, i.e., defining device type enumerators in the dpctl namespace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions