Skip to content

Add --includes and --include-dir to dpnp CLI#2916

Open
vlad-perevezentsev wants to merge 5 commits into
masterfrom
add_dpnp_cli_options
Open

Add --includes and --include-dir to dpnp CLI#2916
vlad-perevezentsev wants to merge 5 commits into
masterfrom
add_dpnp_cli_options

Conversation

@vlad-perevezentsev
Copy link
Copy Markdown
Contributor

This PR adds --includes and --include-dir options to dpnp CLI (python -m dpnp)

These options return the path to dpnp/backend include directory containing dpnp4pybind11.hpp

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?

@github-actions
Copy link
Copy Markdown
Contributor

View rendered docs @ https://intelpython.github.io/dpnp/pull/2916/index.html

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 15, 2026

Array API standard conformance tests for dpnp=0.21.0dev0=py313h509198e_38 ran successfully.
Passed: 1356
Failed: 4
Skipped: 16

@coveralls
Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 78.21% (-0.1%) from 78.324% — add_dpnp_cli_options into master

Copy link
Copy Markdown
Collaborator

@ndgrigorian ndgrigorian left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@antonwolfy antonwolfy left a comment

Choose a reason for hiding this comment

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

The only concern is about documentation, but can be covered separately

Comment thread dpnp/__main__.py
Comment thread CHANGELOG.md

* 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)

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.

extra blank line

Suggested change

Comment thread dpnp/__main__.py


def get_tensor_include_dir() -> str:
"""Prints path to dpnp libtensor include directory"""
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.

Suggested change
"""Prints path to dpnp libtensor include directory"""
"""Returns path to dpnp libtensor include directory"""

Comment thread doc/quick_start_guide.rst
Comment on lines +221 to +222
The ``python -m dpnp`` command provides options to query include paths
needed for building C++ extensions against dpnp:
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.

Suggested change
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:

Comment thread doc/quick_start_guide.rst

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants