File tree Expand file tree Collapse file tree 5 files changed +454
-309
lines changed
Expand file tree Collapse file tree 5 files changed +454
-309
lines changed Original file line number Diff line number Diff line change 1+
12file (GLOB TEST_SOURCES
23 ${CMAKE_CURRENT_SOURCE_DIR} /*.cpp
34 ${CMAKE_CURRENT_SOURCE_DIR} /Matrix/*.cpp
@@ -29,6 +30,36 @@ if(USE_KNL)
2930 target_compile_definitions (TensoriumTests PRIVATE USE_KNL)
3031 target_link_libraries (TensoriumTests PRIVATE memkind)
3132endif ()
33+
34+ find_library (OPENBLAS_LIB
35+ NAMES openblasp openblas
36+ PATHS /opt/OpenBLAS/lib /usr/lib64 /usr/lib /usr/local/lib
37+ )
38+
39+ if (OPENBLAS_LIB)
40+ message (STATUS "OpenBLAS found: ${OPENBLAS_LIB} " )
41+ target_link_libraries (TensoriumTests PRIVATE ${OPENBLAS_LIB} )
42+
43+ if (EXISTS "/opt/OpenBLAS/include/cblas.h" )
44+ target_include_directories (TensoriumTests PRIVATE /opt/OpenBLAS/include )
45+ elseif (EXISTS "/usr/include/openblas/cblas.h" )
46+ target_include_directories (TensoriumTests PRIVATE /usr/include /openblas)
47+ elseif (EXISTS "/usr/include/cblas.h" )
48+ target_include_directories (TensoriumTests PRIVATE /usr/include )
49+ endif ()
50+
51+ else ()
52+ find_package (BLAS)
53+ if (BLAS_FOUND)
54+ message (STATUS "CMake BLAS found: ${BLAS_LIBRARIES} " )
55+ target_link_libraries (TensoriumTests PRIVATE ${BLAS_LIBRARIES} )
56+ else ()
57+ message (WARNING " No BLAS/OpenBLAS library found — BLAS tests will be skipped." )
58+ endif ()
59+ endif ()
60+
61+
62+
3263# set(DISPATCH_PLUGIN_PATH "${CMAKE_BINARY_DIR}/Plugins/libTensoriumDispatchPlugin.so")
3364#
3465# add_dependencies(TensoriumTests TensoriumDispatchPlugin)
You can’t perform that action at this time.
0 commit comments