Add --includes and --include-dir to dpnp CLI#2916
Conversation
|
View rendered docs @ https://intelpython.github.io/dpnp/pull/2916/index.html |
|
Array API standard conformance tests for dpnp=0.21.0dev0=py313h509198e_38 ran successfully. |
antonwolfy
left a comment
There was a problem hiding this comment.
The only concern is about documentation, but can be covered separately
|
|
||
| * Added C API functions for `dpnp.tensor.usm_ndarray` setters and getters to avoid ABI breakage if `dpnp.tensor.usm_ndarray` is modified [gh-2866](https://github.com/IntelPython/dpnp/pull/2866) | ||
| * Added `--includes` and `--include-dir` options to the `dpnp` CLI [#2916](https://github.com/IntelPython/dpnp/pull/2916) | ||
|
|
There was a problem hiding this comment.
extra blank line
|
|
||
|
|
||
| def get_tensor_include_dir() -> str: | ||
| """Prints path to dpnp libtensor include directory""" |
There was a problem hiding this comment.
| """Prints path to dpnp libtensor include directory""" | |
| """Returns path to dpnp libtensor include directory""" |
| The ``python -m dpnp`` command provides options to query include paths | ||
| needed for building C++ extensions against dpnp: |
There was a problem hiding this comment.
| The ``python -m dpnp`` command provides options to query include paths | |
| needed for building C++ extensions against dpnp: | |
| The ``python -m dpnp`` command provides options to query the include paths | |
| needed when building C++ extensions with dpnp: |
|
|
||
| These options are useful when building pybind11 extensions that use | ||
| ``dpnp4pybind11.hpp`` or libtensor kernel headers. | ||
|
|
There was a problem hiding this comment.
might be helpful to add an examples:
For example, to compile a C++ extension using dpnp header using the Intel(R) oneAPI DPC++ compiler:
.. code-block:: bash
icpx -fsycl myextension.cpp $(python -m dpnp --includes) -o myextension.soNot sure if that works this way, based on docs/doc_sources/api_reference/dpctl_pybind11.rst from dpctl.
There was a problem hiding this comment.
we should at least get something to work and then add it as an example.
In theory, the above should work, we just need an extension to test with
This PR adds
--includesand--include-diroptions todpnpCLI (python -m dpnp)These options return the path to
dpnp/backendinclude directory containingdpnp4pybind11.hpp