Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions for selecting current device #247

Closed
2 tasks
PokhodenkoSA opened this issue Jan 22, 2021 · 10 comments
Closed
2 tasks

Functions for selecting current device #247

PokhodenkoSA opened this issue Jan 22, 2021 · 10 comments
Assignees

Comments

@PokhodenkoSA
Copy link
Contributor

PokhodenkoSA commented Jan 22, 2021

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.

@diptorupd
Copy link
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.

@PokhodenkoSA
Copy link
Contributor Author

@diptorupd I propose to meet and discuss it.

@diptorupd
Copy link
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?

@oleksandr-pavlyk
Copy link
Contributor

Vote to close.

@PokhodenkoSA
Copy link
Contributor Author

@diptorupd
What we have now instead of current device?

@oleksandr-pavlyk
Copy link
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.

@PokhodenkoSA
Copy link
Contributor Author

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

@oleksandr-pavlyk
Copy link
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.

@PokhodenkoSA
Copy link
Contributor Author

Thanks.

@diptorupd
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants