Skip to content

Enable oneMath support for dpnp builds #2313

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 6 commits into from
Feb 14, 2025
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
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,20 @@ if(_use_onemkl_interfaces)
else()
FetchContent_Declare(
onemkl_interfaces_library
GIT_REPOSITORY https://github.com/oneapi-src/oneMKL.git
GIT_REPOSITORY https://github.com/uxlfoundation/oneMath.git
GIT_TAG 8f4312ef966420b9b8b4b82b9d5c22e2c91a1fe7 # v0.6
)
endif()

FetchContent_MakeAvailable(onemkl_interfaces_library)
if(TARGET onemath)
set(MKL_INTERFACES_LIB "onemath" CACHE INTERNAL "OneMath lib target")
elseif(TARGET onemkl)
set(MKL_INTERFACES_LIB "onemkl" CACHE INTERNAL "OneMKL lib target")
else()
message(FATAL_ERROR "Neither 'oneMath' nor 'oneMKL' found!")
endif()
message(STATUS "MKL interfaces lib target used: ${MKL_INTERFACES_LIB}")
set(CMAKE_INSTALL_RPATH "${CMAKE_BINARY_DIR}/lib")
endif()

Expand Down
2 changes: 1 addition & 1 deletion dpnp/backend/extensions/blas/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ if (DPNP_GENERATE_COVERAGE)
endif()

if(_use_onemkl_interfaces)
target_link_libraries(${python_module_name} PUBLIC onemkl)
target_link_libraries(${python_module_name} PRIVATE ${MKL_INTERFACES_LIB})
target_compile_options(${python_module_name} PRIVATE -DUSE_ONEMKL_INTERFACES)
if(_use_onemkl_interfaces_cuda)
target_compile_options(${python_module_name} PRIVATE -DUSE_ONEMKL_CUBLAS)
Expand Down
2 changes: 1 addition & 1 deletion dpnp/backend/extensions/fft/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ if (DPNP_GENERATE_COVERAGE)
endif()

if(_use_onemkl_interfaces)
target_link_libraries(${python_module_name} PUBLIC onemkl)
target_link_libraries(${python_module_name} PRIVATE ${MKL_INTERFACES_LIB})
target_compile_options(${python_module_name} PRIVATE -DUSE_ONEMKL_INTERFACES)
else()
target_link_libraries(${python_module_name} PUBLIC MKL::MKL_SYCL::DFT)
Expand Down
2 changes: 1 addition & 1 deletion dpnp/backend/extensions/lapack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ if (DPNP_GENERATE_COVERAGE)
endif()

if(_use_onemkl_interfaces)
target_link_libraries(${python_module_name} PUBLIC onemkl)
target_link_libraries(${python_module_name} PRIVATE ${MKL_INTERFACES_LIB})
target_compile_options(${python_module_name} PRIVATE -DUSE_ONEMKL_INTERFACES)
else()
target_link_libraries(${python_module_name} PUBLIC MKL::MKL_SYCL::LAPACK)
Expand Down
Loading