1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
|
# Copyright (c) 2017-2023, University of Tennessee. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# This program is free software: you can redistribute it and/or modify it under
# the terms of the BSD 3-Clause license. See the accompanying LICENSE file.
# Can't build testers if CBLAS, LAPACK, or TestSweeper are not found.
if (NOT blaspp_cblas_found)
message( WARNING "CBLAS not found; tester cannot be built." )
return()
endif()
if (NOT LAPACK_FOUND)
message( WARNING "LAPACK not found; tester cannot be built." )
return()
endif()
# Search for TestSweeper library, if not already included (e.g., in SLATE).
message( STATUS "${bold}Checking for TestSweeper library${not_bold}" )
if (NOT TARGET testsweeper)
find_package( testsweeper QUIET )
if (testsweeper_FOUND)
message( " ${blue}Found TestSweeper library: ${testsweeper_DIR}${plain}" )
message( "" )
else()
set( url "https://github.com/icl-utk-edu/testsweeper" )
set( tag "v2024.05.31" )
message( "" )
message( "---------- TestSweeper" )
message( STATUS "Fetching TestSweeper ${tag} from ${url}" )
include( FetchContent )
FetchContent_Declare( testsweeper GIT_REPOSITORY "${url}"
GIT_TAG "${tag}" )
FetchContent_MakeAvailable( testsweeper )
message( "---------- TestSweeper done" )
message( "" )
endif()
else()
message( " ${blue}TestSweeper already included${plain}" )
endif()
#-------------------------------------------------------------------------------
set( tester "${blaspp_}tester" )
add_executable(
${tester}
test.cc
test_util.cc
test_asum.cc
test_axpy.cc
test_batch_gemm.cc
test_batch_hemm.cc
test_batch_her2k.cc
test_batch_herk.cc
test_batch_symm.cc
test_batch_syr2k.cc
test_batch_syrk.cc
test_batch_trmm.cc
test_batch_trsm.cc
test_copy.cc
test_dot.cc
test_dotu.cc
test_error.cc
test_gemm.cc
test_gemv.cc
test_ger.cc
test_geru.cc
test_hemm.cc
test_hemv.cc
test_her.cc
test_her2.cc
test_her2k.cc
test_herk.cc
test_iamax.cc
test_max.cc
test_memcpy.cc
test_memcpy_2d.cc
test_nrm2.cc
test_rot.cc
test_rotg.cc
test_rotm.cc
test_rotmg.cc
test_scal.cc
test_swap.cc
test_symm.cc
test_symv.cc
test_syr.cc
test_syr2.cc
test_syr2k.cc
test_syrk.cc
test_trmm.cc
test_trmv.cc
test_trsm.cc
test_trsv.cc
cblas_wrappers.cc
lapack_wrappers.cc
test_batch_gemm_device.cc
test_batch_hemm_device.cc
test_batch_her2k_device.cc
test_batch_herk_device.cc
test_schur_gemm.cc
test_batch_symm_device.cc
test_batch_syr2k_device.cc
test_batch_syrk_device.cc
test_batch_trmm_device.cc
test_batch_trsm_device.cc
test_axpy_device.cc
test_dot_device.cc
test_dotu_device.cc
test_nrm2_device.cc
test_scal_device.cc
test_swap_device.cc
test_copy_device.cc
test_gemm_device.cc
test_hemm_device.cc
test_her2k_device.cc
test_herk_device.cc
test_symm_device.cc
test_syr2k_device.cc
test_syrk_device.cc
test_trmm_device.cc
test_trsm_device.cc
)
# C++11 is inherited from blaspp, but disabling extensions is not.
set_target_properties( ${tester} PROPERTIES CXX_EXTENSIONS false )
target_link_libraries(
${tester}
testsweeper
blaspp
${blaspp_cblas_libraries}
${lapack_libraries_}
)
target_include_directories(
${tester}
PRIVATE
"${blaspp_cblas_include}"
)
# Copy run_tests script to build directory.
add_custom_command(
TARGET ${tester} POST_BUILD
COMMAND
cp ${CMAKE_CURRENT_SOURCE_DIR}/run_tests.py
${CMAKE_CURRENT_BINARY_DIR}/run_tests.py
)
if (blaspp_is_project)
add_custom_target(
"check"
COMMAND
python3 run_tests.py --quick
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
)
endif()
|