-
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
Open
ndgrigorian
wants to merge
12
commits into
master
Choose a base branch
from
add-libtensor-pybind11-example
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
12 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| #.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) | ||
|
|
||
| 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 | ||
| ) | ||
| get_filename_component(_dpnp_dir "${Dpnp_INCLUDE_DIR}" DIRECTORY) | ||
|
|
||
| find_path( | ||
| Dpnp_TENSOR_INCLUDE_DIR | ||
| kernels | ||
| utils | ||
|
ndgrigorian marked this conversation as resolved.
Outdated
|
||
| PATHS "${_dpnp_dir}/tensor/libtensor/include" | ||
| ) | ||
|
|
||
| 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) | ||
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
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.