|
18 | 18 | #=============================================================================== |
19 | 19 |
|
20 | 20 | # Build object from all test sources |
21 | | -set(BATCH_SOURCES "copy_batch_stride.cpp" "axpy_batch_stride.cpp" "dgmm_batch_stride.cpp" "gemm_batch_stride.cpp" "gemv_batch_stride.cpp" "trsm_batch_stride.cpp" "syrk_batch_stride.cpp" "copy_batch_usm.cpp" "copy_batch_stride_usm.cpp" "axpy_batch_usm.cpp" "axpy_batch_stride_usm.cpp" "dgmm_batch_usm.cpp" "dgmm_batch_stride_usm.cpp" "gemm_batch_usm.cpp" "gemm_batch_stride_usm.cpp" "gemv_batch_usm.cpp" "gemv_batch_stride_usm.cpp" "trsm_batch_usm.cpp" "trsm_batch_stride_usm.cpp" "syrk_batch_usm.cpp" "syrk_batch_stride_usm.cpp" "omatcopy_batch_stride.cpp" "omatcopy_batch_stride_usm.cpp" "imatcopy_batch_stride.cpp" "imatcopy_batch_stride_usm.cpp" "omatadd_batch_stride.cpp" "omatadd_batch_stride_usm.cpp" "omatcopy_batch_usm.cpp" "imatcopy_batch_usm.cpp") |
| 21 | +set(BATCH_SOURCES_W_CBLAS "copy_batch_stride.cpp" "axpy_batch_stride.cpp" "dgmm_batch_stride.cpp" "gemm_batch_stride.cpp" "gemv_batch_stride.cpp" "trsm_batch_stride.cpp" "syrk_batch_stride.cpp" "copy_batch_usm.cpp" "copy_batch_stride_usm.cpp" "axpy_batch_usm.cpp" "axpy_batch_stride_usm.cpp" "dgmm_batch_usm.cpp" "dgmm_batch_stride_usm.cpp" "gemm_batch_usm.cpp" "gemm_batch_stride_usm.cpp" "gemv_batch_usm.cpp" "gemv_batch_stride_usm.cpp" "trsm_batch_usm.cpp" "trsm_batch_stride_usm.cpp" "syrk_batch_usm.cpp" "syrk_batch_stride_usm.cpp" "omatcopy_batch_stride.cpp" "omatcopy_batch_stride_usm.cpp" "imatcopy_batch_stride.cpp" "imatcopy_batch_stride_usm.cpp" "omatadd_batch_stride.cpp" "omatadd_batch_stride_usm.cpp" "omatcopy_batch_usm.cpp" "imatcopy_batch_usm.cpp") |
| 22 | +# TODO: add list of tests without Netlib dependency |
| 23 | +set(BATCH_SOURCES) |
22 | 24 |
|
23 | 25 | if(BUILD_SHARED_LIBS) |
24 | | - add_library(blas_batch_rt OBJECT ${BATCH_SOURCES}) |
| 26 | + add_library(blas_batch_rt OBJECT $<$<BOOL:${CBLAS_FOUND}>:${BATCH_SOURCES_W_CBLAS}> ${BATCH_SOURCES}) |
25 | 27 | target_compile_options(blas_batch_rt PRIVATE -DCALL_RT_API -DNOMINMAX) |
26 | 28 | target_include_directories(blas_batch_rt |
27 | 29 | PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../include |
28 | 30 | PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../include |
29 | 31 | PUBLIC ${PROJECT_SOURCE_DIR}/include |
30 | 32 | PUBLIC ${PROJECT_SOURCE_DIR}/deps/googletest/include |
31 | 33 | PUBLIC ${CMAKE_BINARY_DIR}/bin |
32 | | - PUBLIC ${CBLAS_INCLUDE} |
| 34 | + $<$<BOOL:${CBLAS_FOUND}>:${CBLAS_INCLUDE}> |
33 | 35 | ) |
34 | 36 | if (USE_ADD_SYCL_TO_TARGET_INTEGRATION) |
35 | | - add_sycl_to_target(TARGET blas_batch_rt SOURCES ${BATCH_SOURCES}) |
| 37 | + add_sycl_to_target(TARGET blas_batch_rt SOURCES $<$<BOOL:${CBLAS_FOUND}>:${BATCH_SOURCES_W_CBLAS}> ${BATCH_SOURCES}) |
36 | 38 | else() |
37 | 39 | target_link_libraries(blas_batch_rt PUBLIC ONEMKL::SYCL::SYCL) |
38 | 40 | endif() |
39 | 41 | endif() |
40 | 42 |
|
41 | | -add_library(blas_batch_ct OBJECT ${BATCH_SOURCES}) |
| 43 | +add_library(blas_batch_ct OBJECT $<$<BOOL:${CBLAS_FOUND}>:${BATCH_SOURCES_W_CBLAS}> ${BATCH_SOURCES}) |
42 | 44 | target_compile_options(blas_batch_ct PRIVATE -DNOMINMAX) |
43 | 45 | target_include_directories(blas_batch_ct |
44 | 46 | PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../include |
45 | 47 | PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../include |
46 | 48 | PUBLIC ${PROJECT_SOURCE_DIR}/include |
47 | 49 | PUBLIC ${PROJECT_SOURCE_DIR}/deps/googletest/include |
48 | 50 | PUBLIC ${CMAKE_BINARY_DIR}/bin |
49 | | - PUBLIC ${CBLAS_INCLUDE} |
| 51 | + $<$<BOOL:${CBLAS_FOUND}>:${CBLAS_INCLUDE}> |
50 | 52 | ) |
51 | 53 | if (USE_ADD_SYCL_TO_TARGET_INTEGRATION) |
52 | | - add_sycl_to_target(TARGET blas_batch_ct SOURCES ${BATCH_SOURCES}) |
| 54 | + add_sycl_to_target(TARGET blas_batch_ct SOURCES $<$<BOOL:${CBLAS_FOUND}>:${BATCH_SOURCES_W_CBLAS}> ${BATCH_SOURCES}) |
53 | 55 | else() |
54 | 56 | target_link_libraries(blas_batch_ct PUBLIC ONEMKL::SYCL::SYCL) |
55 | 57 | endif() |
0 commit comments