2010-02-24 01:23:12 +08:00
|
|
|
|
2011-03-23 18:08:10 +08:00
|
|
|
|
|
|
|
if((NOT EIGEN3_INCLUDE_DIR) AND Eigen_SOURCE_DIR)
|
|
|
|
# unless EIGEN3_INCLUDE_DIR is defined, let's use current Eigen version
|
|
|
|
set(EIGEN3_INCLUDE_DIR ${Eigen_SOURCE_DIR})
|
|
|
|
set(EIGEN3_FOUND TRUE)
|
|
|
|
else()
|
|
|
|
find_package(Eigen3)
|
|
|
|
endif()
|
|
|
|
|
2011-01-27 02:12:35 +08:00
|
|
|
if (EIGEN3_FOUND)
|
2008-07-09 22:04:48 +08:00
|
|
|
|
2011-01-27 02:12:35 +08:00
|
|
|
include_directories(${EIGEN3_INCLUDE_DIR})
|
2010-02-24 01:23:12 +08:00
|
|
|
btl_add_bench(btl_eigen3_linear main_linear.cpp)
|
|
|
|
btl_add_bench(btl_eigen3_vecmat main_vecmat.cpp)
|
|
|
|
btl_add_bench(btl_eigen3_matmat main_matmat.cpp)
|
|
|
|
btl_add_bench(btl_eigen3_adv main_adv.cpp )
|
2009-03-09 22:16:05 +08:00
|
|
|
|
2010-02-24 01:23:12 +08:00
|
|
|
btl_add_target_property(btl_eigen3_linear COMPILE_FLAGS "-fno-exceptions -DBTL_PREFIX=eigen3")
|
|
|
|
btl_add_target_property(btl_eigen3_vecmat COMPILE_FLAGS "-fno-exceptions -DBTL_PREFIX=eigen3")
|
|
|
|
btl_add_target_property(btl_eigen3_matmat COMPILE_FLAGS "-fno-exceptions -DBTL_PREFIX=eigen3")
|
|
|
|
btl_add_target_property(btl_eigen3_adv COMPILE_FLAGS "-fno-exceptions -DBTL_PREFIX=eigen3")
|
2009-03-09 22:16:05 +08:00
|
|
|
|
|
|
|
option(BTL_BENCH_NOGCCVEC "also bench Eigen explicit vec without GCC's auto vec" OFF)
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX AND BTL_BENCH_NOGCCVEC)
|
2010-02-24 01:23:12 +08:00
|
|
|
btl_add_bench(btl_eigen3_nogccvec_linear main_linear.cpp)
|
|
|
|
btl_add_bench(btl_eigen3_nogccvec_vecmat main_vecmat.cpp)
|
|
|
|
btl_add_bench(btl_eigen3_nogccvec_matmat main_matmat.cpp)
|
|
|
|
btl_add_bench(btl_eigen3_nogccvec_adv main_adv.cpp )
|
|
|
|
|
|
|
|
btl_add_target_property(btl_eigen3_nogccvec_linear COMPILE_FLAGS "-fno-exceptions -fno-tree-vectorize -DBTL_PREFIX=eigen3_nogccvec")
|
|
|
|
btl_add_target_property(btl_eigen3_nogccvec_vecmat COMPILE_FLAGS "-fno-exceptions -fno-tree-vectorize -DBTL_PREFIX=eigen3_nogccvec")
|
|
|
|
btl_add_target_property(btl_eigen3_nogccvec_matmat COMPILE_FLAGS "-fno-exceptions -fno-tree-vectorize -DBTL_PREFIX=eigen3_nogccvec")
|
|
|
|
btl_add_target_property(btl_eigen3_nogccvec_adv COMPILE_FLAGS "-fno-exceptions -fno-tree-vectorize -DBTL_PREFIX=eigen3_nogccvec")
|
2009-03-09 22:16:05 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
if(NOT BTL_NOVEC)
|
2011-03-23 18:08:10 +08:00
|
|
|
btl_add_bench(btl_eigen3_novec_linear main_linear.cpp OFF)
|
|
|
|
btl_add_bench(btl_eigen3_novec_vecmat main_vecmat.cpp OFF)
|
|
|
|
btl_add_bench(btl_eigen3_novec_matmat main_matmat.cpp OFF)
|
|
|
|
btl_add_bench(btl_eigen3_novec_adv main_adv.cpp OFF)
|
2010-02-24 01:23:12 +08:00
|
|
|
btl_add_target_property(btl_eigen3_novec_linear COMPILE_FLAGS "-fno-exceptions -DEIGEN_DONT_VECTORIZE -DBTL_PREFIX=eigen3_novec")
|
|
|
|
btl_add_target_property(btl_eigen3_novec_vecmat COMPILE_FLAGS "-fno-exceptions -DEIGEN_DONT_VECTORIZE -DBTL_PREFIX=eigen3_novec")
|
|
|
|
btl_add_target_property(btl_eigen3_novec_matmat COMPILE_FLAGS "-fno-exceptions -DEIGEN_DONT_VECTORIZE -DBTL_PREFIX=eigen3_novec")
|
|
|
|
btl_add_target_property(btl_eigen3_novec_adv COMPILE_FLAGS "-fno-exceptions -DEIGEN_DONT_VECTORIZE -DBTL_PREFIX=eigen3_novec")
|
|
|
|
|
|
|
|
# if(BUILD_btl_eigen3_adv)
|
|
|
|
# target_link_libraries(btl_eigen3_adv ${MKL_LIBRARIES})
|
2019-11-01 00:36:27 +08:00
|
|
|
# endif()
|
2009-03-09 22:16:05 +08:00
|
|
|
|
2019-11-01 00:36:27 +08:00
|
|
|
endif()
|
2008-07-11 02:28:50 +08:00
|
|
|
|
2010-02-24 01:23:12 +08:00
|
|
|
btl_add_bench(btl_tiny_eigen3 btl_tiny_eigen3.cpp OFF)
|
2008-07-11 02:28:50 +08:00
|
|
|
|
2009-03-09 22:16:05 +08:00
|
|
|
if(NOT BTL_NOVEC)
|
2010-02-24 01:23:12 +08:00
|
|
|
btl_add_bench(btl_tiny_eigen3_novec btl_tiny_eigen3.cpp OFF)
|
|
|
|
btl_add_target_property(btl_tiny_eigen3_novec COMPILE_FLAGS "-DBTL_PREFIX=eigen3_tiny")
|
2009-03-09 22:16:05 +08:00
|
|
|
|
2010-02-24 01:23:12 +08:00
|
|
|
if(BUILD_btl_tiny_eigen3_novec)
|
|
|
|
btl_add_target_property(btl_tiny_eigen3_novec COMPILE_FLAGS "-DEIGEN_DONT_VECTORIZE -DBTL_PREFIX=eigen3_tiny_novec")
|
2019-11-01 00:36:27 +08:00
|
|
|
endif()
|
|
|
|
endif()
|
2009-03-09 22:16:05 +08:00
|
|
|
|
2019-11-01 00:36:27 +08:00
|
|
|
endif ()
|