-
Notifications
You must be signed in to change notification settings - Fork 30
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
Feature/sycl context #334
Feature/sycl context #334
Conversation
Minimal example:
|
@oleksandr-pavlyk Please rebase on top of #338. |
438e80a
to
07384c5
Compare
I think it is better for #338 to get merged into master, and for me to merge master into this branch. If the intent is to experiment with #338, then I can always merge the associated branch into this one locally to test. Have 2021 update 2 been released yet? |
Merged #338 here. |
I think this PR is ready. Linux tests passed. Windows - pytest run seg-faults:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oleksandr-pavlyk Please move the changes to sycl_queue.pyx
and sycl_platform.pyx
and related pxd
files into a separate PR. Apart from that some minor changes that I found.
fb1bf0c
to
2ad7a16
Compare
Because of several merging that resolved conflicts, it is an involved operation. I will attempt it, but frankly I see little value in doing this exercise. |
Just a suggestion. Let us not bother if it is too involved. |
2ad7a16
to
065b7b7
Compare
Added test to cover that functionality, added it to _backend.pyx
[X] Implementation [X] Header + Documentation comment [X] Two tests in test_sycl_context.cpp [X] Exported in `dpctl/_backend.pxd`
Returns list of SyclDevice objects associated with the given queue.
Added method device_count (perhaps could be a property), and used it to give different __repr__ outputs for single-device contexts and multi-device context instances.
When creating from a device, we must look up cached DeviceAndContext pair first, and only if that fails call DPCTLContext_Create SyclContext was not doing a look-up, and SyclQueue was not doing the creation is the lookup were to fail.
Added two more tests to test_sycl_context.py One of them is skipped due to a bug in DPC++, which is expected to be fixed in update 2 of oneAPI 2021
Also fixed alignment of colons in the docstring.
Prominently state that _create deletes its argument reference variable. DPCTL opaque pointers will be consumed by most _init_* functions. Enabled test which was xfailed waiting for the DPCPP update.
Modified test to reflect that.
references by opaque pointers in the given array, making these copies is removed from Cython.
065b7b7
to
f5846cf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Sasha!
@diptorupd This is a WIP to add SyclContext constructors, including those multi-device context.
This works
However, when using different instances of device, it does not work: