Added Device class representing Data-API notion of device#440
Merged
oleksandr-pavlyk merged 2 commits intomasterfrom May 13, 2021
Merged
Added Device class representing Data-API notion of device#440oleksandr-pavlyk merged 2 commits intomasterfrom
oleksandr-pavlyk merged 2 commits intomasterfrom
Conversation
4428ac5 to
6cc07d4
Compare
diptorupd
reviewed
May 11, 2021
diptorupd
reviewed
May 11, 2021
diptorupd
reviewed
May 11, 2021
6cc07d4 to
ca33bfe
Compare
Data-API notion of device is higher level abstraction. The class
does allow for public constructor, has class method to create
instance instead.
It typesets as Device(filter_string) for parent devices and
Device(queue) for sub-devices. It can constructed from
- filter selector string
- SyclDevice corresponding to a root device
(attempt at passing sub-device raises and error)
- SyclQueue
- Another instance of Device class
It implements sycl_queue, sycl_device, sycl_context attributes.
usm_ndarray adds .device property, and .to_device(device) method.
```
In [5]: X = dpt.usm_ndarray((4, 5), dtype='d')
In [6]: X.device
Out[6]: Device(level_zero:gpu:0)
In [7]: Y = X.to_device('cpu')
In [8]: Y.device
Out[8]: Device(opencl:cpu:0)
```
ca33bfe to
f2c5f18
Compare
diptorupd
approved these changes
May 13, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Data-API notion of device is higher level abstraction. The class
does allow for public constructor, has class method to create
instance instead.
It typesets as Device(filter_string) for parent devices and
Device(queue) for sub-devices. It can constructed from
(attempt at passing sub-device raises and error)
It implements sycl_queue, sycl_device, sycl_context attributes.
usm_ndarray adds .device property, and .to_device(device) method.