Skip to content

Functions for selecting current device #247

Closed

Description

@PokhodenkoSA

Now current device is changed via dpctl.device_context. Internally it changes current device at enter to context and return previous device on exit from context. Functions for changing current device should be provided in API.

Functions:

  • select_device
  • close

Also functions could provide access to internal contexts stack.

Activity

  1. diptorupd commented on Mar 15, 2021

    @diptorupd
    Contributor

    @PokhodenkoSA can you clarify what exactly needs to be done here? The concept of default queue is going to go away from dpctl. Instead we can make the dpctl._SyclQueueManager class public and numba-dppy can use it to manage a current queue for numba-dppy.

    Also, the recent changes that got merged into master adds an API call dpctl.set_global_queue to change the current queue without having to use a with dpctl.device_context. The function previously existed as dpctl.set_default_queue.

  2. PokhodenkoSA commented on Apr 5, 2021

    @PokhodenkoSA
    ContributorAuthor

    @diptorupd I propose to meet and discuss it.

  3. diptorupd commented on Oct 10, 2021

    @diptorupd
    Contributor

    The device manager has been significantly modified to let users create SYCL devices as they wish. The notion of current device is deprecated and we will not have the feature in dpctl eventually. @oleksandr-pavlyk Fine with closing the issue?

  4. oleksandr-pavlyk commented on Oct 11, 2021

    @oleksandr-pavlyk
    Contributor

    Vote to close.

  5. PokhodenkoSA commented on Oct 12, 2021

    @PokhodenkoSA
    ContributorAuthor

    @diptorupd
    What we have now instead of current device?

  6. oleksandr-pavlyk commented on Oct 12, 2021

    @oleksandr-pavlyk
    Contributor

    Explicit creation of devices/queues.

    • dpctl.SyclDevice() gives default selected device
    • dpctl.SyclQueue() gives queue constructed from default selector.
    • dpctl.SyclQueue(filter_string) constructs sycl queue from given filter selector string.
  7. PokhodenkoSA commented on Oct 13, 2021

    @PokhodenkoSA
    ContributorAuthor

    How dpctl.device_context() is working now? Does not it change some variable which is used buy code inside the context?

  8. oleksandr-pavlyk commented on Oct 13, 2021

    @oleksandr-pavlyk
    Contributor

    dpctl.device_context currently works by manipulating a singleton class implementing a stack. The global nature of this class makes it async-unsafe, e.g. #11.

    With adoption of computation follows data paradigm, dpctl.device_context becomes deprecated and should eventually be removed.

  9. PokhodenkoSA commented on Oct 13, 2021

    @PokhodenkoSA
    ContributorAuthor

    Thanks.

  10. diptorupd commented on Mar 1, 2024

    @diptorupd
    Contributor

    Closing as the design based on a "current device" has been removed and the device manager code is also slotted to be removed.

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

Metadata

Metadata

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