Merged
Conversation
This function deduces the type of USM allocation for the output array based on USM types of the input arrays. Changed behavior of get_execution_queue(sequence_of_queues). Queues are equivalent now when they compare equal, i.e. q1 == q2 is True. This means that they are Python wrappers about copies of the same underlying SYCL queue. Since dpctl.SyclQueue() and dpctl.SyclQueue() produce two distinct instances they no longer are equivalent, and will not be compatible in the compute follows data paradigm. arr.to_device can be used to zero-copy reattach the new queue to the data provided that the original queue and the new queue have the same underlying SYCL context, which guarantees that SYCL pointer can be dereferenced in the new queue.
Contributor
Author
|
A forthcoming PR would implement caching for the mapping from filter strings and unpartitioned devices to queues. |
Contributor
Author
|
@PokhodenkoSA @Alexander-Makaryev @diptorupd The change to I would therefore not merge this until such caching is implemented. |
|
View rendered docs @ https://intelpython.github.io/dpctl/pulls/797/index.html |
Collaborator
…vices to queues As a result of this `X = dpt.empty((10,), device="gpu")` and `Y=dpt.empty((10,), device="gpu")` would have the same associated queue, i.e. `X.sycl_queue is Y.sycl_queue` would give True
…or strings produce identical cached queue
f8d473d to
99f017d
Compare
Contributor
Author
The caching has been implemented now: |
|
Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞 |
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.
Adds
dpctl.utils.get_coerced_usm_typeto deduce the usm type for the output array based on usm types of input arrays.Also modified behavior of
dpctl.utils.get_execution_queue. The notion of equivalency has changed. Now two queues are equivalent if they compare equal, i.e.q1 == q2. This is true when the underlying C++ class instances are copies of the same underlying instance.Note that
dpctl.SyclQueue() == dpctl.SyclQueue()returnsFalse, and so woulddpctl.SyclQueue("cpu") == dpctl.SyclQueue("cpu").To bring two arrays to equivalent queues, do
Yc = Y.to_device(X.device), and thenfoo(X, Yc)iffoo(X, Y)was raising due to incompatible queues.