Skip to content

Backport gh-2199 #2217

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 10 commits into from
Dec 5, 2024
Merged
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ This is a bug-fix release.
### Fixed

* Resolved an issue with Compute Follows Data inconsistency in `dpnp.extract` function [#2172](https://github.com/IntelPython/dpnp/pull/2172)
* Resolves an import error when using `dpnp` in virtual environment on Linux [#2199](https://github.com/IntelPython/dpnp/pull/2199)
* Resolved a compilation error when building with DPC++ 2025.1 compiler [#2211](https://github.com/IntelPython/dpnp/pull/2211)


## [0.16.0] - 10/14/2024

This release reaches an important milestone by making offloading fully asynchronous. Calls to `dpnp` submit tasks for execution to DPC++ runtime and return without waiting for execution of these tasks to finish. The sequential semantics a user comes to expect from execution of Python script is preserved though.
Expand Down
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ project(dpnp
DESCRIPTION "NumPy-like API accelerated by SYCL."
)

option(DPNP_GENERATE_COVERAGE "Enable build DPNP with coverage instrumentation" FALSE)
option(DPNP_BACKEND_TESTS "Enable building of DPNP backend test suite" FALSE)
option(DPNP_GENERATE_COVERAGE "Enable build DPNP with coverage instrumentation" OFF)
option(DPNP_BACKEND_TESTS "Enable building of DPNP backend test suite" OFF)
option(DPNP_WITH_REDIST "Build DPNP assuming DPC++ redistributable is installed into Python prefix" OFF)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
Expand Down
2 changes: 1 addition & 1 deletion conda-recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if DEFINED OVERRIDE_INTEL_IPO (
set "SKBUILD_ARGS=%SKBUILD_ARGS% -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=FALSE"
)

FOR %%V IN (14.0.0 14 15.0.0 15 16.0.0 16 17.0.0 17) DO @(
FOR %%V IN (17.0.0 17 18.0.0 18 19.0.0 19) DO @(
REM set DIR_HINT if directory exists
IF EXIST "%BUILD_PREFIX%\Library\lib\clang\%%V\" (
SET "SYCL_INCLUDE_DIR_HINT=%BUILD_PREFIX%\Library\lib\clang\%%V"
Expand Down
3 changes: 2 additions & 1 deletion conda-recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# This is necessary to help DPC++ find Intel libraries such as SVML, IRNG, etc in build prefix
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${BUILD_PREFIX}/lib"
export LIBRARY_PATH="$LIBRARY_PATH:${BUILD_PREFIX}/lib"

# Intel LLVM must cooperate with compiler and sysroot from conda
echo "--gcc-toolchain=${BUILD_PREFIX} --sysroot=${BUILD_PREFIX}/${HOST}/sysroot -target ${HOST}" > icpx_for_conda.cfg
Expand All @@ -18,6 +18,7 @@ export DPL_ROOT_HINT=$PREFIX
export MKL_ROOT_HINT=$PREFIX
SKBUILD_ARGS=(-- "-DCMAKE_C_COMPILER:PATH=icx" "-DCMAKE_CXX_COMPILER:PATH=icpx" "-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON")
SKBUILD_ARGS=("${SKBUILD_ARGS[@]}" "-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON")
SKBUILD_ARGS=("${SKBUILD_ARGS[@]}" "-DDPNP_WITH_REDIST:BOOL=ON")

# Build wheel package
WHEELS_BUILD_ARGS=("-p" "manylinux_2_28_x86_64")
Expand Down
11 changes: 7 additions & 4 deletions dpnp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
function(build_dpnp_cython_ext _trgt _src _dest)
set(options SYCL)
cmake_parse_arguments(BUILD_DPNP_EXT "${options}" "" "" ${ARGN})
add_cython_target(${_trgt} ${_src} CXX OUTPUT_VAR _generated_src)
message(STATUS "Using ${_trgt}")

Expand Down Expand Up @@ -41,15 +40,19 @@ function(build_dpnp_cython_ext _trgt _src _dest)
VERBATIM COMMENT "Copying Cython-generated source for target ${_trgt} to dpnp source layout"
)
endif()

set(_rpath_value "$ORIGIN/..")
if (DPNP_WITH_REDIST)
set(_rpath_value "${_rpath_value}:$ORIGIN/../../../../")
endif()
set_target_properties(${_trgt} PROPERTIES INSTALL_RPATH ${_rpath_value})

install(TARGETS ${_trgt} LIBRARY DESTINATION ${_dest})
endfunction()

function(build_dpnp_cython_ext_with_backend _trgt _src _dest)
build_dpnp_cython_ext(${_trgt} ${_src} ${_dest})
target_link_libraries(${_trgt} PRIVATE dpnp_backend_library)
if (UNIX)
set_target_properties(${_trgt} PROPERTIES INSTALL_RPATH "$ORIGIN/..")
endif()
endfunction()

add_subdirectory(backend)
Expand Down
4 changes: 4 additions & 0 deletions dpnp/backend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ add_library(dpnp_backend_library INTERFACE IMPORTED GLOBAL)
target_include_directories(dpnp_backend_library BEFORE INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/src)
target_link_libraries(dpnp_backend_library INTERFACE ${_trgt})

if (DPNP_WITH_REDIST)
set_target_properties(${python_module_name} PROPERTIES INSTALL_RPATH "$ORIGIN/../../../")
endif()

if (DPNP_BACKEND_TESTS)
add_subdirectory(tests)
endif()
Expand Down
4 changes: 4 additions & 0 deletions dpnp/backend/extensions/blas/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ else()
target_link_libraries(${python_module_name} PUBLIC MKL::MKL_SYCL::BLAS)
endif()

if (DPNP_WITH_REDIST)
set_target_properties(${python_module_name} PROPERTIES INSTALL_RPATH "$ORIGIN/../../../../../../")
endif()

install(TARGETS ${python_module_name}
DESTINATION "dpnp/backend/extensions/blas"
)
4 changes: 4 additions & 0 deletions dpnp/backend/extensions/fft/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ else()
target_link_libraries(${python_module_name} PUBLIC MKL::MKL_SYCL::DFT)
endif()

if (DPNP_WITH_REDIST)
set_target_properties(${python_module_name} PROPERTIES INSTALL_RPATH "$ORIGIN/../../../../../../")
endif()

install(TARGETS ${python_module_name}
DESTINATION "dpnp/backend/extensions/fft"
)
4 changes: 4 additions & 0 deletions dpnp/backend/extensions/lapack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ else()
target_link_libraries(${python_module_name} PUBLIC MKL::MKL_SYCL::LAPACK)
endif()

if (DPNP_WITH_REDIST)
set_target_properties(${python_module_name} PROPERTIES INSTALL_RPATH "$ORIGIN/../../../../../../")
endif()

install(TARGETS ${python_module_name}
DESTINATION "dpnp/backend/extensions/lapack"
)
4 changes: 4 additions & 0 deletions dpnp/backend/extensions/ufunc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ if (DPNP_GENERATE_COVERAGE)
target_link_options(${python_module_name} PRIVATE -fprofile-instr-generate -fcoverage-mapping)
endif()

if (DPNP_WITH_REDIST)
set_target_properties(${python_module_name} PROPERTIES INSTALL_RPATH "$ORIGIN/../../../../../../")
endif()

install(TARGETS ${python_module_name}
DESTINATION "dpnp/backend/extensions/ufunc"
)
4 changes: 4 additions & 0 deletions dpnp/backend/extensions/vm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ else()
target_link_libraries(${python_module_name} PUBLIC MKL::MKL_SYCL::VM)
endif()

if (DPNP_WITH_REDIST)
set_target_properties(${python_module_name} PROPERTIES INSTALL_RPATH "$ORIGIN/../../../../../../")
endif()

install(TARGETS ${python_module_name}
DESTINATION "dpnp/backend/extensions/vm"
)
Loading