Decouple pybind11 and kernels#1516
Conversation
This change affected linspace, arange, and full constructors. This change causes no user visible changes.
Removed uses of `#include <pybind11/pybind11.h>` from header files in libtensor/include/kernels folder Replaced `#include <CL/sycl.hpp>` with `#include <sycl/sycl.hpp>`. Introduced "kernels/dpctl_tensor_types.hpp" which defines the type, and included it in header files. Added static_assert in some CPP files to ensure that `py::ssize_t` is the same as `dpctl::tensor::ssize_t`.
|
Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞 |
|
Array API standard conformance tests for dpctl=0.15.1dev3=py310h15de555_51 ran successfully. |
|
@oleksandr-pavlyk |
|
I deliberately left Files in the kernel subfolder do not, so I think we should leave |
Since utils headers are used in kernels, to make kernels/ independent of pybind11, it is necessary to ensure that all depedent header files also do not include pybind11. Changed offset_utils to use dpctl::tensor::ssize_t instead of py::ssize_t. Factored out pybind11 independent components of type_dispatch.hpp header into type_dispatch_building.hpp . What remains uses dpctl4pybind11 and hence genuinely depends on pybind11.
|
Array API standard conformance tests for dpctl=0.15.1dev3=py310h15de555_52 ran successfully. |
ndgrigorian
left a comment
There was a problem hiding this comment.
LGTM, thank you for tackling this @oleksandr-pavlyk !
Moved all uses of pybind11 types and functions out of
libtensor/include/kernels.py::objectand casters were moved to respective*.cppfiles.dpctl::tensor::ssize_twas definedpy::ssize_tin function signatures replaced with of library'sssize_ttype#include "pybind11/pybind11.h"removed (speeding up compilation time)static_assert(std::is_same_v(py::ssize_t, dpctl::tensor:;ssize_t>)in aome*.cppfiles#include <CL/sycl.hpp>has been replaced with#include <sycl/sycl.hpp>.