-
Notifications
You must be signed in to change notification settings - Fork 26
Refactor dpnp includes and add extension example #2941
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
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
82a59d1
Add and install dpnp-config.cmake
ndgrigorian 1547e62
refactor dpnp includes
ndgrigorian 22fe46e
add dpnp4pybind11.hpp where transiently included
ndgrigorian 82d90b9
add pybind11 extension
ndgrigorian c735f53
run pybind11 example in CI
ndgrigorian 5ce4ee9
pin compiler in example test run
ndgrigorian a84e5fc
address review feedback
ndgrigorian 4c05f49
fix stray copyright date in use_dpnp_array setup.py
ndgrigorian 020e5ea
use two find_path calls in dpnp-config.cmake
ndgrigorian f162a9d
address PR review
ndgrigorian 4a4e5d2
Merge branch 'master' into add-libtensor-pybind11-example
vlad-perevezentsev d0127f3
Merge branch 'master' into add-libtensor-pybind11-example
ndgrigorian cded248
apply review comments
ndgrigorian 9b70628
Merge branch 'master' into add-libtensor-pybind11-example
ndgrigorian 6ac4c8b
pre-commit fix
ndgrigorian 8730fa6
examples environment fixes
ndgrigorian 4cd26db
Merge branch 'master' into add-libtensor-pybind11-example
ndgrigorian 4fb12d0
fix examples.yml formatting
ndgrigorian fc060a9
Merge branch 'master' into add-libtensor-pybind11-example
ndgrigorian 8066951
add NO_DEFAULT_PATH to dpnp-config
ndgrigorian 7304e4b
Merge branch 'master' into add-libtensor-pybind11-example
ndgrigorian f3148d1
pre-commit fix
ndgrigorian 48cdb57
Merge branch 'master' into add-libtensor-pybind11-example
ndgrigorian c196e77
add gh-2941 to changelog
ndgrigorian 0275144
Merge branch 'master' into add-libtensor-pybind11-example
antonwolfy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| #.rst: | ||
| # | ||
| # Find the include directory for ``dpnp4pybind11.hpp`` and dpnp tensor kernels. | ||
| # | ||
| # This module sets the following variables: | ||
| # | ||
| # ``Dpnp_FOUND`` | ||
| # True if DPNP was found. | ||
| # ``Dpnp_INCLUDE_DIR`` | ||
| # The include directory needed to use dpnp. | ||
| # ``Dpnp_TENSOR_INCLUDE_DIR`` | ||
| # The include directory for tensor kernels implementation. | ||
| # ``Dpnp_VERSION`` | ||
| # The version of dpnp found. | ||
| # | ||
| # The module will also explicitly define two cache variables: | ||
| # | ||
| # ``Dpnp_INCLUDE_DIR`` | ||
| # ``Dpnp_TENSOR_INCLUDE_DIR`` | ||
| # | ||
|
|
||
| if(NOT Dpnp_FOUND) | ||
| find_package(Python 3.10 REQUIRED COMPONENTS Interpreter Development.Module) | ||
|
ndgrigorian marked this conversation as resolved.
|
||
|
|
||
| if(Python_EXECUTABLE) | ||
| execute_process( | ||
| COMMAND "${Python_EXECUTABLE}" -m dpnp --include-dir | ||
| OUTPUT_VARIABLE _dpnp_include_dir | ||
| OUTPUT_STRIP_TRAILING_WHITESPACE | ||
| ERROR_QUIET | ||
| ) | ||
| execute_process( | ||
| COMMAND "${Python_EXECUTABLE}" -c "import dpnp; print(dpnp.__version__)" | ||
| OUTPUT_VARIABLE Dpnp_VERSION | ||
| OUTPUT_STRIP_TRAILING_WHITESPACE | ||
| ERROR_QUIET | ||
| ) | ||
| endif() | ||
| endif() | ||
|
|
||
| find_path( | ||
| Dpnp_INCLUDE_DIR | ||
| dpnp4pybind11.hpp | ||
| PATHS "${_dpnp_include_dir}" "${Python_INCLUDE_DIRS}" | ||
| PATH_SUFFIXES dpnp/include | ||
|
ndgrigorian marked this conversation as resolved.
|
||
| NO_DEFAULT_PATH | ||
| ) | ||
| get_filename_component(_dpnp_dir "${Dpnp_INCLUDE_DIR}" DIRECTORY) | ||
|
|
||
| find_path( | ||
| Dpnp_TENSOR_INCLUDE_DIR | ||
| kernels | ||
| PATHS "${_dpnp_dir}/tensor/libtensor/include" | ||
| NO_DEFAULT_PATH | ||
| ) | ||
|
|
||
| set(Dpnp_INCLUDE_DIRS ${Dpnp_INCLUDE_DIR}) | ||
|
|
||
| # handle the QUIETLY and REQUIRED arguments and set Dpnp_FOUND to TRUE if | ||
| # all listed variables are TRUE | ||
| include(FindPackageHandleStandardArgs) | ||
| find_package_handle_standard_args( | ||
| Dpnp | ||
| REQUIRED_VARS Dpnp_INCLUDE_DIR Dpnp_TENSOR_INCLUDE_DIR | ||
| VERSION_VAR Dpnp_VERSION | ||
| ) | ||
|
|
||
| mark_as_advanced(Dpnp_INCLUDE_DIR) | ||
| mark_as_advanced(Dpnp_TENSOR_INCLUDE_DIR) | ||
|
ndgrigorian marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.