mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Remove obsolete bench/ and btl/ directories
libeigen/eigen!2217 Co-authored-by: Rasmus Munk Larsen <rmlarsen@gmail.com>
This commit is contained in:
@@ -74,9 +74,6 @@ if (EIGEN_BUILD_BLAS OR EIGEN_BUILD_LAPACK)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(EIGEN_BUILD_BTL "Build benchmark suite" OFF)
|
||||
option(EIGEN_BUILD_SPBENCH "Build sparse benchmark suite" OFF)
|
||||
option(EIGEN_BUILD_AOCL_BENCH "Build AOCL benchmark" OFF)
|
||||
# Avoid building docs if included from another project.
|
||||
# Building documentation requires creating and running executables on the host
|
||||
# platform. We shouldn't do this if cross-compiling.
|
||||
@@ -93,7 +90,7 @@ if(NOT WIN32 OR NOT CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
|
||||
endif()
|
||||
option(EIGEN_BUILD_CMAKE_PACKAGE "Enables the creation of EigenConfig.cmake and related files" ${PROJECT_IS_TOP_LEVEL})
|
||||
|
||||
if (EIGEN_BUILD_TESTING OR EIGEN_BUILD_BLAS OR EIGEN_BUILD_LAPACK OR EIGEN_BUILT_BTL OR EIGEN_BUILD_BTL OR EIGEN_BUILD_SPBENCH OR EIGEN_BUILD_DOC OR EIGEN_BUILD_DEMOS)
|
||||
if (EIGEN_BUILD_TESTING OR EIGEN_BUILD_BLAS OR EIGEN_BUILD_LAPACK OR EIGEN_BUILD_DOC OR EIGEN_BUILD_DEMOS)
|
||||
set(EIGEN_IS_BUILDING_ ON)
|
||||
endif()
|
||||
|
||||
@@ -764,66 +761,6 @@ if(EIGEN_BUILD_DOC)
|
||||
add_subdirectory(doc EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
# TODO: consider also replacing EIGEN_BUILD_BTL by a custom target "make btl"?
|
||||
if(EIGEN_BUILD_BTL)
|
||||
add_subdirectory(bench/btl EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
if(NOT WIN32 AND EIGEN_BUILD_SPBENCH)
|
||||
add_subdirectory(bench/spbench EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
#--------------------------------------------------------------------------------------#
|
||||
# AOCL BENCHMARK BUILD SECTION #
|
||||
#--------------------------------------------------------------------------------------#
|
||||
if(EIGEN_BUILD_AOCL_BENCH)
|
||||
# Allow users to override the default architecture
|
||||
set(EIGEN_AOCL_BENCH_ARCH "znver5" CACHE STRING "Target architecture for AOCL benchmark")
|
||||
add_executable(benchmark_aocl EXCLUDE_FROM_ALL bench/benchmark_aocl.cpp)
|
||||
include(CheckCXXCompilerFlag)
|
||||
check_cxx_compiler_flag("-march=${EIGEN_AOCL_BENCH_ARCH}" COMPILER_SUPPORTS_AOCL_ARCH)
|
||||
if(COMPILER_SUPPORTS_AOCL_ARCH)
|
||||
target_compile_options(benchmark_aocl PRIVATE -O3 -Wno-shadow -march=${EIGEN_AOCL_BENCH_ARCH})
|
||||
else()
|
||||
message(WARNING "${EIGEN_AOCL_BENCH_ARCH} architecture not supported by compiler")
|
||||
target_compile_options(benchmark_aocl PRIVATE -O3)
|
||||
endif()
|
||||
|
||||
# Add custom flags if provided
|
||||
if(EIGEN_AOCL_BENCH_FLAGS)
|
||||
separate_arguments(CUSTOM_FLAGS NATIVE_COMMAND "${EIGEN_AOCL_BENCH_FLAGS}")
|
||||
target_compile_options(benchmark_aocl PRIVATE ${CUSTOM_FLAGS})
|
||||
# Check if OpenMP is requested in custom flags and link it
|
||||
string(FIND "${EIGEN_AOCL_BENCH_FLAGS}" "-fopenmp" OPENMP_REQUESTED)
|
||||
if(NOT OPENMP_REQUESTED EQUAL -1)
|
||||
find_package(OpenMP)
|
||||
if(OpenMP_CXX_FOUND)
|
||||
target_link_libraries(benchmark_aocl OpenMP::OpenMP_CXX)
|
||||
else()
|
||||
# Generic fallback: let compiler handle OpenMP linking
|
||||
if(MSVC)
|
||||
target_compile_options(benchmark_aocl PRIVATE "/openmp")
|
||||
else()
|
||||
target_compile_options(benchmark_aocl PRIVATE "-fopenmp")
|
||||
target_link_options(benchmark_aocl PRIVATE "-fopenmp")
|
||||
endif()
|
||||
message(STATUS "Using compiler OpenMP flags as fallback")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_include_directories(benchmark_aocl PRIVATE ${INCLUDE_INSTALL_DIR})
|
||||
if(EIGEN_AOCL_BENCH_USE_MT)
|
||||
target_compile_definitions(benchmark_aocl PRIVATE EIGEN_USE_AOCL_MT)
|
||||
else()
|
||||
target_compile_definitions(benchmark_aocl PRIVATE EIGEN_USE_AOCL_ALL)
|
||||
endif()
|
||||
target_link_libraries(benchmark_aocl Eigen3::Eigen)
|
||||
if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
|
||||
target_link_libraries(benchmark_aocl ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
|
||||
endif()
|
||||
endif()
|
||||
#----------------------------------------------------------------------------------------#
|
||||
|
||||
if (EIGEN_BUILD_DEMOS)
|
||||
add_subdirectory(demos EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
@@ -872,9 +809,6 @@ if(PROJECT_IS_TOP_LEVEL)
|
||||
if (EIGEN_BUILD_LAPACK)
|
||||
message(STATUS "lapack | Build LAPACK subset library (not the same thing as Eigen)")
|
||||
endif()
|
||||
if(EIGEN_BUILD_AOCL_BENCH)
|
||||
message(STATUS "benchmark_aocl | Build AOCL benchmark executable")
|
||||
endif()
|
||||
message(STATUS "------------+--------------------------------------------------------------")
|
||||
message(STATUS "")
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user