Skip to content

Commit 0d5ffad

Browse files
Enable oneMath support for dpnp builds (#2313)
Since `oneMKL Interfaces` has been renamed to `oneMath` this PR suggests adding automatic interface name detection for future releases while maintaining compatibility with the old unrenamed versions (onemkl) Additionally changes `oneMKL` repository URL to `oneMath`
1 parent 93535bd commit 0d5ffad

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,20 @@ if(_use_onemkl_interfaces)
121121
else()
122122
FetchContent_Declare(
123123
onemkl_interfaces_library
124-
GIT_REPOSITORY https://github.com/oneapi-src/oneMKL.git
124+
GIT_REPOSITORY https://github.com/uxlfoundation/oneMath.git
125125
GIT_TAG 8f4312ef966420b9b8b4b82b9d5c22e2c91a1fe7 # v0.6
126126
)
127127
endif()
128128

129129
FetchContent_MakeAvailable(onemkl_interfaces_library)
130+
if(TARGET onemath)
131+
set(MKL_INTERFACES_LIB "onemath" CACHE INTERNAL "OneMath lib target")
132+
elseif(TARGET onemkl)
133+
set(MKL_INTERFACES_LIB "onemkl" CACHE INTERNAL "OneMKL lib target")
134+
else()
135+
message(FATAL_ERROR "Neither 'oneMath' nor 'oneMKL' found!")
136+
endif()
137+
message(STATUS "MKL interfaces lib target used: ${MKL_INTERFACES_LIB}")
130138
set(CMAKE_INSTALL_RPATH "${CMAKE_BINARY_DIR}/lib")
131139
endif()
132140

dpnp/backend/extensions/blas/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ if (DPNP_GENERATE_COVERAGE)
8484
endif()
8585

8686
if(_use_onemkl_interfaces)
87-
target_link_libraries(${python_module_name} PUBLIC onemkl)
87+
target_link_libraries(${python_module_name} PRIVATE ${MKL_INTERFACES_LIB})
8888
target_compile_options(${python_module_name} PRIVATE -DUSE_ONEMKL_INTERFACES)
8989
if(_use_onemkl_interfaces_cuda)
9090
target_compile_options(${python_module_name} PRIVATE -DUSE_ONEMKL_CUBLAS)

dpnp/backend/extensions/fft/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ if (DPNP_GENERATE_COVERAGE)
8383
endif()
8484

8585
if(_use_onemkl_interfaces)
86-
target_link_libraries(${python_module_name} PUBLIC onemkl)
86+
target_link_libraries(${python_module_name} PRIVATE ${MKL_INTERFACES_LIB})
8787
target_compile_options(${python_module_name} PRIVATE -DUSE_ONEMKL_INTERFACES)
8888
else()
8989
target_link_libraries(${python_module_name} PUBLIC MKL::MKL_SYCL::DFT)

dpnp/backend/extensions/lapack/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ if (DPNP_GENERATE_COVERAGE)
101101
endif()
102102

103103
if(_use_onemkl_interfaces)
104-
target_link_libraries(${python_module_name} PUBLIC onemkl)
104+
target_link_libraries(${python_module_name} PRIVATE ${MKL_INTERFACES_LIB})
105105
target_compile_options(${python_module_name} PRIVATE -DUSE_ONEMKL_INTERFACES)
106106
else()
107107
target_link_libraries(${python_module_name} PUBLIC MKL::MKL_SYCL::LAPACK)

0 commit comments

Comments
 (0)