Conversation
This function caches queues by (context, device) key. The cache is stored in contextvars.ContextVar variable, learning our lessons from issue gh-11. get_device_cached_queue(dev : dpctl.SyclDevice) -> dpctl.SyclQueue get_device_cached_queue( (ctx: dpctl.SyclContext, dev : dpctl.SyclDevice) ) -> dpctl.SyclQueue Function retrieves the queue from cache, or adds the new queue instance there if previously absent.
Queue is looked up from cache for default-selected device.
|
View rendered docs @ https://intelpython.github.io/dpctl/pulls/1076/index.html |
|
Array API standard conformance tests for dpctl=0.14.1dev2=py310h41425db_21 ran successfully. |
|
Array API standard conformance tests for dpctl=0.14.1dev2=py310h41425db_29 ran successfully. |
antonwolfy
left a comment
There was a problem hiding this comment.
I've tested together with dpnp and it works fine. Thank you! LGTM!
vlad-perevezentsev
left a comment
There was a problem hiding this comment.
Great job! Thank you @oleksandr-pavlyk
|
Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞 |
I do not expect numba-dpex to use this functionality. |
|
Array API standard conformance tests for dpctl=0.14.1dev2=py310h41425db_31 ran successfully. |
|
This is the use case I had in mind: To support these constructors inside the |
|
@diptorupd Yes, and I can add support for string argument for sure, but without boxing/unboxing support for |
yes, that is on my next set of todos |
This PR creates dedicate queue cache with context, device pair being a key.
Use of this cache in
dpctl.tensor.Device,dpctl.tensor.from_dlpackand indpctl.memoryallows to returns the same queue for a given device, streamlining user experience with compute-follows-data model.