File tree Expand file tree Collapse file tree
include/oneapi/math/lapack/detail/armpl Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -316,9 +316,9 @@ else()
316316 endif ()
317317endif ()
318318
319- if (DEFINED REF_BLAS_ROOT)
320- find_file (ONEMATH_REF_BLAS_LIBNAME NAMES blas.dll libblas.so HINTS ${REF_BLAS_ROOT} PATH_SUFFIXES lib lib64 )
321- find_file (ONEMATH_REF_CBLAS_LIBNAME NAMES cblas.dll libcblas.so HINTS ${REF_BLAS_ROOT} PATH_SUFFIXES lib lib64 )
319+ if (DEFINED REF_BLAS_ROOT OR DEFINED REF_LAPACK_ROOT )
320+ find_file (ONEMATH_REF_BLAS_LIBNAME NAMES blas.dll libblas.so HINTS ${REF_BLAS_ROOT} ${REF_LAPACK_ROOT } PATH_SUFFIXES lib lib64 )
321+ find_file (ONEMATH_REF_CBLAS_LIBNAME NAMES cblas.dll libcblas.so HINTS ${REF_BLAS_ROOT} ${REF_LAPACK_ROOT } PATH_SUFFIXES lib lib64 )
322322endif ()
323323
324324# Add source directory and output to bin/
Original file line number Diff line number Diff line change 1919
2020include_guard ()
2121
22- find_library (CBLAS_file NAMES cblas.dll.lib cblas.lib cblas HINTS ${REF_BLAS_ROOT} PATH_SUFFIXES lib lib64 )
22+ find_library (CBLAS_file NAMES cblas.dll.lib cblas.lib cblas HINTS ${REF_BLAS_ROOT} ${REF_LAPACK_ROOT} PATH_SUFFIXES lib lib64 )
2323find_package_handle_standard_args (CBLAS REQUIRED_VARS CBLAS_file)
24- find_library (BLAS_file NAMES blas.dll.lib blas.lib blas HINTS ${REF_BLAS_ROOT} PATH_SUFFIXES lib lib64 )
24+ find_library (BLAS_file NAMES blas.dll.lib blas.lib blas HINTS ${REF_BLAS_ROOT} ${REF_LAPACK_ROOT} PATH_SUFFIXES lib lib64 )
2525find_package_handle_standard_args (CBLAS REQUIRED_VARS BLAS_file)
2626
2727get_filename_component (CBLAS_LIB_DIR ${CBLAS_file} DIRECTORY )
28- find_path (CBLAS_INCLUDE cblas.h HINTS ${REF_BLAS_ROOT} PATH_SUFFIXES include )
28+ find_path (CBLAS_INCLUDE cblas.h HINTS ${REF_BLAS_ROOT} ${REF_LAPACK_ROOT} PATH_SUFFIXES include )
2929
3030if (UNIX )
3131 list (APPEND CBLAS_LINK "-Wl,-rpath,${CBLAS_LIB_DIR} " )
Original file line number Diff line number Diff line change @@ -30,6 +30,11 @@ set(EXAMPLE_TARGET example_lapack_getrs_usm_mklcpu_cusolver)
3030# Create a CMake target with one source file
3131add_executable (${EXAMPLE_TARGET} getrs_usm_mklcpu_cusolver.cpp )
3232
33+ # May be needed to compile source files with SYCL kernels
34+ if (USE_ADD_SYCL_TO_TARGET_INTEGRATION)
35+ add_sycl_to_target (TARGET ${EXAMPLE_TARGET} SOURCES getrs_usm_mklcpu_cusolver.cpp )
36+ endif ()
37+
3338# Linking against onemath_lapack_mklcpu and onemath_lapack_cusolver in CMake will add the required include directories and dependencies.
3439# One can also link against `onemath_lapack` to link against all the lapack backends built.
3540# These targets should only be used for compile-time dispatching.
@@ -44,4 +49,4 @@ target_include_directories(${EXAMPLE_TARGET} PUBLIC
4449)
4550
4651# Register example as ctest
47- add_test (NAME lapack/EXAMPLE/CT/getrs_usm_mklcpu_cusolver COMMAND ${EXAMPLE_TARGET} )
52+ add_test (NAME lapack/EXAMPLE/CT/getrs_usm_mklcpu_cusolver COMMAND ${EXAMPLE_TARGET} )
Original file line number Diff line number Diff line change @@ -39,13 +39,17 @@ endif()
3939message (STATUS "ONEAPI_DEVICE_SELECTOR will be set to the following value(s): [${DEVICE_FILTERS} ] for run-time dispatching examples" )
4040
4141set (EXAMPLE_TARGET example_lapack_getrs_usm)
42-
4342# External applications should use find_package or FetchContent to include oneMath first.
4443# See https://github.com/uxlfoundation/oneMath/blob/develop/docs/using_onemath_with_cmake.rst
4544
4645# Create a CMake target with one source file
4746add_executable (${EXAMPLE_TARGET} getrs_usm.cpp )
4847
48+ # May be needed to compile source files with SYCL kernels
49+ if (USE_ADD_SYCL_TO_TARGET_INTEGRATION)
50+ add_sycl_to_target (TARGET ${EXAMPLE_TARGET} SOURCES getrs_usm.cpp )
51+ endif ()
52+
4953# Linking against onemath in CMake will add the required include directories and dependencies.
5054# This target should only be used for runtime dispatching.
5155target_link_libraries (${EXAMPLE_TARGET} PUBLIC onemath )
Original file line number Diff line number Diff line change 2323
2424#include < complex>
2525#include < cstdint>
26-
26+ // this may have been defined in complex.h and conflicts with enums in types.hpp
27+ #undef I
2728#include " oneapi/math/types.hpp"
2829namespace oneapi {
2930namespace math {
Original file line number Diff line number Diff line change 1919
2020set (TEST_TARGET_DOMAINS ${TARGET_DOMAINS} )
2121
22- if ("blas" IN_LIST TEST_TARGET_DOMAINS)
22+ if (( "blas" IN_LIST TEST_TARGET_DOMAINS) OR ( "lapack" IN_LIST TEST_TARGET_DOMAINS) )
2323 find_package (CBLAS )
2424 if (NOT CBLAS_FOUND)
2525 # TODO: add list of tests without Netlib dependency
26- message (WARNING "Netlib CBLAS headers or libraries are not found, BLAS unit tests will be skipped" )
27- list (REMOVE_ITEM TEST_TARGET_DOMAINS "blas" )
26+ message (WARNING "Netlib CBLAS headers or libraries are not found, BLAS/LAPACK unit tests will be skipped" )
27+ list (REMOVE_ITEM TEST_TARGET_DOMAINS "blas" "lapack" )
2828 endif ()
2929endif ()
3030
@@ -67,7 +67,7 @@ set(lapack_TEST_LIST
6767 lapack_source)
6868
6969if (LAPACKE_FOUND)
70- set (lapack_TEST_LINK ${LAPACKE_LINK} )
70+ set (lapack_TEST_LINK "" )
7171endif ()
7272
7373# RNG config
@@ -245,6 +245,8 @@ foreach(domain ${TEST_TARGET_DOMAINS})
245245
246246 if (domain STREQUAL "blas" AND CBLAS_FOUND)
247247 set (TEST_LD_LIBRARY_PATH ${CMAKE_BINARY_DIR} /lib:${CBLAS_LIB_DIR} :$ENV{LD_LIBRARY_PATH} )
248+ elseif (domain STREQUAL "lapack" AND LAPACKE_FOUND)
249+ set (TEST_LD_LIBRARY_PATH ${CMAKE_BINARY_DIR} /lib:${LAPACKE64_LIB_DIR} :${CBLAS_LIB_DIR} :$ENV{LD_LIBRARY_PATH} )
248250 else ()
249251 set (TEST_LD_LIBRARY_PATH ${CMAKE_BINARY_DIR} /lib:$ENV{LD_LIBRARY_PATH} )
250252 endif ()
Original file line number Diff line number Diff line change 1616#
1717# SPDX-License-Identifier: Apache-2.0
1818#===============================================================================
19-
19+ add_compile_definitions (
20+ ONEMATH_REF_LAPACK_LIBNAME= "${LAPACK64_file} "
21+ ONEMATH_REF_LAPACKE_LIBNAME= "${LAPACKE64_file} "
22+ ONEMATH_REF_CBLAS_LIBNAME= "${ONEMATH_REF_CBLAS_LIBNAME} " )
2023add_subdirectory (source )
2124add_subdirectory (common )
You can’t perform that action at this time.
0 commit comments