Skip to content

Sycl wrappers #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

Merged
merged 5 commits into from
Sep 18, 2020
Merged

Sycl wrappers #30

merged 5 commits into from
Sep 18, 2020

Conversation

diptorupd
Copy link
Contributor

@diptorupd diptorupd commented Sep 15, 2020

This PR adds wrappers for sycl::context and sycl::device classes. In addition, the Sycl queue manager is separated out from the wrapper for sycl::queue. In the Cython extension, we now have three new extension types: SyclQueue, SyclDevice, SyclContext. The SyclQueue class replaces the previous use of a Py_Capsule to store the DPPLSyclQueueRef pointer.

The changes in this PR lay the groundwork for adding the next set of changes needed to move Numba from OpenCL to Sycl.

Still needs unit tests and more documentation, but is otherwise ready for review.

…erfaces.

     - Separates out the queue manager from the sycl queue interface wrapper.
     - Added API to get context, device froma  Sycl queue.
     - Added C-API wrappers for sycl device, queue, context interfaces exposing
       some of the API functionalities. More can be added as needed.
     - The dppl extension now defines extension types for sycl quque, device, context to
       mimic the C API.
     - Sycl queues are now returned to callers as a SyclQueue extension type rather than
       a Py_capsule.
@diptorupd diptorupd marked this pull request as ready for review September 16, 2020 04:25
Copy link
Contributor

@PokhodenkoSA PokhodenkoSA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DPPL_API missings are most important. Please, modify and I will check on Windows.
In other places I am expecting only comments on my review notes.
In the whole looks good for me.


void error_reporter (const std::string & msg)
{
throw std::runtime_error("Error: " + msg);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the library provides C interface then all exceptions should not cross the boundary of C API. So all exceptions must be caught inside the library.
Just a point to discuss. Write your thoughts please if you are disagree.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again #35

@diptorupd
Copy link
Contributor Author

Merging with the following pending issues #42, #41, #35.

@diptorupd diptorupd merged commit 811855d into IntelPython:master Sep 18, 2020
@diptorupd diptorupd deleted the sycl_wrappers branch September 19, 2020 00:50
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

Successfully merging this pull request may close these issues.

2 participants