Skip to content

Add support for events, programs, and kernel submission to dpctl. #80

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

Conversation

diptorupd
Copy link
Contributor

* New dpctl C API wrappers for sycl::event, sycl::kernel and sycl::program.
* Wrappers to create an OpenCL interoperability program from either string
  or SPIR-V IL files.
* Support for submitting an interoperability kernel to a sycl::queue. We
  support using either a range or an nd_range to submit the kernel.
* Event wait function is now exposed via the C API.
* New test cases for the C API.
* The dpctl Cython wrapper now supports program creation and kernel
  submission.
* Other refactoring to standardize function names, attribute names, comments.

    * New dpctl C API wrappers for sycl::event, sycl::kernel and sycl::program.
    * Wrappers to create an OpenCL interoperability program from either string
      or SPIR-V IL files.
    * Support for submitting an interoperability kernel to a sycl::queue. We
      support using either a range or an nd_range to submit the kernel.
    * Event wait function is now exposed via the C API.
    * New test cases for the C API.
    * The dpctl Cython wrapper now supports program creation and kernel
      submission.
    * Other refactoring to standardize function names, attribute names, comments.
@diptorupd
Copy link
Contributor Author

Closes #52, #77.

diptorupd and others added 4 commits September 30, 2020 16:21
Add new line at end of file.
    * Remove empty doxygen comment blocks
    * Fix indentation
    * Fix grammatical typos
@diptorupd diptorupd force-pushed the feature/program_interfacev2 branch from 390c747 to e48ba39 Compare October 1, 2020 02:31
diptorupd and others added 2 commits September 30, 2020 22:27
    - The default queue points to a Level-0 device is Level-0 drivers
      are installed. However, we always compile our program for OpenCL
      and this causes a crash if the test kernels are submitted to the
      default queue.

      Fixing it by selecting the GPU:0 queue that is known to be an
      OpenCL device. A follow up commit will fix this in a proper way.
cdef void DPPLQueue_Memcpy (const DPPLSyclQueueRef Q,
void *Dest, const void *Src, size_t Count) \
except +
void *Dest, const void *Src, size_t Count)
Copy link
Contributor

Choose a reason for hiding this comment

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

@diptorupd as I remember you wanted to make Memcpy to return SyclEvent. In the next PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I will open a follow up. Refer #84

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.

LGTM.

/*!
* @brief Create a Sycl program from an OpenCL SPIR-V binary file.
*
* Sycl 1.2 does expose any method to create a sycl::program from a SPIR-V IL
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you mean 'does not expose'?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch. Fixed now.

* OpenCL kernel.
*
* The feature to create a Sycl kernel from a SPIR-V IL binary will be available
* in Sycl 2.0, at which point we may deprecate this function.
Copy link
Contributor

Choose a reason for hiding this comment

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

It is better to say, "at which point this function may become deprecated."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the comment. Thanks.

* @param cgh My Param doc
* @param Arg My Param doc
*/
bool set_kernel_arg (handler &cgh, size_t idx, __dppl_keep void *Arg,
Copy link
Contributor

Choose a reason for hiding this comment

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

We will eventually need to support complexes as well.

This is not straightforward with ctypes: https://stackoverflow.com/questions/13373291/complex-number-in-ctypes

So down the road we might just introduce our own scalar type in dpctl.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Opened #85 to track the issue.

@PokhodenkoSA PokhodenkoSA merged commit 7f3b868 into IntelPython:master Oct 2, 2020
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.

3 participants