-
Notifications
You must be signed in to change notification settings - Fork 30
Cleanup/tensor #941
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
Cleanup/tensor #941
Conversation
This is to avoid multiple definitions compilation error when using multiple translation units.
…efinition of' compilation error messages
Moved implementation of kernels out to dedicated header files.
Use -O1 when compiling tensor_py for now to work around suspected issue with loading of C-API functions.
…es`. The class is already singleton. Instead create a local variable at each use site. This local variable is going to be a constant reference to the singleton.
[cleanup/tensor, part 2] Modularized tests for contiguity, retrieval of PyUSMArrayObject* and removed use of a global variable.
The class implements a singleton pattern that populates global variables exported by Cython CAPI functions via call to import_dpctl() and then populates internal struct members with pointers populated by Cython. This loads both Cython 'public api' functions, types, and integer values. dpctl::tensor::usm_ndarray and dpctl::memory::usm_memory classes, as well as type-casters for dpctl.SyclQueue <-> sycl::queue, dpctl.SyclDevice <-> sycl::device, etc. use dpctl_capi. The singleton patterns helps avoid static initialization order fiasco problem when using multiple translation units. Single dpctl_capi loads typenum values, the dpctl::tensor::detail::usm_ndarray_types struct no longer needs to be a singleton, and becomes an ordinary struct with a static method. tensor_py.cpp was changed to reflect that.
[cleanup/tensor, step 3] Implement dpctl_capi loader in dpctl4pybind11 header file
This is avoid using py::value_error and py::ssize_t and py::type_error in there explicitly. Use in tensor_py.cpp adjusted
[cleanup/tensor, part 4] Made contract_iter and contract_iter2 functions templated to avoid needing to include pybind11 headers
…ed file Also moved routine for simplification of iteration space into dedicated file
View rendered docs @ https://intelpython.github.io/dpctl/pulls/941/index.html |
Array API standard conformance tests for dpctl=0.14.0dev0=py310h8c27c75_192 ran successfully. |
This individual merges were reviewed, and CI is green, merging. |
Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞 |
Array API standard conformance tests for dpctl=0.14.0dev0=py310h8c27c75_192 ran successfully. |
This PR is the composition of #925 #931 #932 #933 #934
This PR supersedes #923.