-
Notifications
You must be signed in to change notification settings - Fork 30
Examples added #197
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
Examples added #197
Conversation
1. Cython/sycl_direct_linkage Example of native extension "cdef import"-ing sycl C++ classes directly from CL/sycl.hpp Queue is created within the function, adding measurable overhead. Extension uses GEMV to compute column-wise total of a C-contiguous matrix, and illustrates linking to oneMKL. 2. Cython/sycl_bufer Example of native extension building on the above, but illustrating getting the queue from dpctl. 3. Cython/usm_memory Example of native extension allocating USM shared memory via dpctl, and using it as a buffer underlying NumPy array. Cython functions dispatches to a SYCL code that works with USM pointer. One function populates USM memory underneath NumPy array with random numbers using ``oneapi::mkl::rng::device`` function used in SYCL kernel, with random number being parameters of European vanilla options. The second function uses SYCL to price these options using Black-Scholes formula.
Is it possible to create makefile for building Cython examples? |
We can add an optional cmake option to build the examples? Should we also add examples for the C API in this folder? |
Each example can be built using |
@diptorupd |
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.
Could you please update main README.md section Examples too?
Merging, as this is a big improvement over what we have currently. |
Closes #187
This PR reorganizes
examples/
folder. The current structure is as follows:Examples in
python/
folder intend to show usage ofdpctl
from Python. Perhaps this folder may also showcase usage ofctypes
to interface withDPPLSyclInterface
shared library.Examples in
cython/
folder intend to provide examples of building Cython extensions usingdpctl
.Forthcoming examples will show
pybind11
as well as SWIG, which will go in their respective folders.