Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This release is compatible with NumPy 2.4.5.

* 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 support for buffer protocol objects as advanced index keys in `dpnp.ndarray` [#2889](https://github.com/IntelPython/dpnp/pull/2889)
* Added `--includes` and `--include-dir` options to the `dpnp` CLI [#2916](https://github.com/IntelPython/dpnp/pull/2916)

Comment thread
vlad-perevezentsev marked this conversation as resolved.
### Changed

Expand Down
17 changes: 17 additions & 0 deletions doc/quick_start_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,23 @@ devices at the same time:
python scripts/build_locally.py --target-cuda --target-hip=gfx90a


Command-Line Interface
======================

The ``python -m dpnp`` command provides options to query the include paths
needed when building C++ extensions with dpnp:

.. code-block:: bash

python -m dpnp --includes # print -I flag for dpnp include directory
python -m dpnp --include-dir # print path to dpnp include directory
python -m dpnp --tensor-includes # print -I flag for libtensor include directory
python -m dpnp --tensor-include-dir # print path to libtensor include directory

These options are useful when building pybind11 extensions that use
``dpnp4pybind11.hpp`` or libtensor kernel headers.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.so

Not sure if that works this way, based on docs/doc_sources/api_reference/dpctl_pybind11.rst from dpctl.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@ndgrigorian @antonwolfy
I think it would be better to do this in PR that adds examples to dpnp


Testing
=======

Expand Down
2 changes: 1 addition & 1 deletion dpnp/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def print_include_flags() -> None:


def get_tensor_include_dir() -> str:
"""Prints path to dpnp libtensor include directory"""
"""Returns path to dpnp libtensor include directory"""
libtensor_dir = os.path.join(_dpnp_dir(), "tensor", "libtensor", "include")
return libtensor_dir

Expand Down
Loading