1 2 3if((NOT TENSOR_INCLUDE_DIR) AND Eigen_SOURCE_DIR) 4 # unless TENSOR_INCLUDE_DIR is defined, let's use current Eigen version 5 set(TENSOR_INCLUDE_DIR ${Eigen_SOURCE_DIR}) 6 set(TENSOR_FOUND TRUE) 7else() 8 find_package(Tensor) 9endif() 10 11if (TENSOR_FOUND) 12 13 include_directories(${TENSOR_INCLUDE_DIR}) 14 btl_add_bench(btl_tensor_linear main_linear.cpp) 15 btl_add_bench(btl_tensor_vecmat main_vecmat.cpp) 16 btl_add_bench(btl_tensor_matmat main_matmat.cpp) 17 18 btl_add_target_property(btl_tensor_linear COMPILE_FLAGS "-fno-exceptions -DBTL_PREFIX=tensor") 19 btl_add_target_property(btl_tensor_vecmat COMPILE_FLAGS "-fno-exceptions -DBTL_PREFIX=tensor") 20 btl_add_target_property(btl_tensor_matmat COMPILE_FLAGS "-fno-exceptions -DBTL_PREFIX=tensor") 21 22 option(BTL_BENCH_NOGCCVEC "also bench Eigen explicit vec without GCC's auto vec" OFF) 23 if(CMAKE_COMPILER_IS_GNUCXX AND BTL_BENCH_NOGCCVEC) 24 btl_add_bench(btl_tensor_nogccvec_linear main_linear.cpp) 25 btl_add_bench(btl_tensor_nogccvec_vecmat main_vecmat.cpp) 26 btl_add_bench(btl_tensor_nogccvec_matmat main_matmat.cpp) 27 28 btl_add_target_property(btl_tensor_nogccvec_linear COMPILE_FLAGS "-fno-exceptions -fno-tree-vectorize -DBTL_PREFIX=tensor_nogccvec") 29 btl_add_target_property(btl_tensor_nogccvec_vecmat COMPILE_FLAGS "-fno-exceptions -fno-tree-vectorize -DBTL_PREFIX=tensor_nogccvec") 30 btl_add_target_property(btl_tensor_nogccvec_matmat COMPILE_FLAGS "-fno-exceptions -fno-tree-vectorize -DBTL_PREFIX=tensor_nogccvec") 31 endif() 32 33 34 if(NOT BTL_NOVEC) 35 btl_add_bench(btl_tensor_novec_linear main_linear.cpp OFF) 36 btl_add_bench(btl_tensor_novec_vecmat main_vecmat.cpp OFF) 37 btl_add_bench(btl_tensor_novec_matmat main_matmat.cpp OFF) 38 btl_add_target_property(btl_tensor_novec_linear COMPILE_FLAGS "-fno-exceptions -DEIGEN_DONT_VECTORIZE -DBTL_PREFIX=tensor_novec") 39 btl_add_target_property(btl_tensor_novec_vecmat COMPILE_FLAGS "-fno-exceptions -DEIGEN_DONT_VECTORIZE -DBTL_PREFIX=tensor_novec") 40 btl_add_target_property(btl_tensor_novec_matmat COMPILE_FLAGS "-fno-exceptions -DEIGEN_DONT_VECTORIZE -DBTL_PREFIX=tensor_novec") 41 42 endif(NOT BTL_NOVEC) 43 44endif (TENSOR_FOUND) 45