mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
imported a reworked version of BTL (Benchmark for Templated Libraries).
the modifications to initial code follow: * changed build system from plain makefiles to cmake * added eigen2 (4 versions: vec/novec and fixed/dynamic), GMM++, MTL4 interfaces * added "transposed matrix * vector" product action * updated blitz interface to use condensed products instead of hand coded loops * removed some deprecated interfaces * changed default storage order to column major for all libraries * new generic bench timer strategy which is supposed to be more accurate * various code clean-up
This commit is contained in:
40
bench/btl/cmake/FindBlitz.cmake
Normal file
40
bench/btl/cmake/FindBlitz.cmake
Normal file
@@ -0,0 +1,40 @@
|
||||
# - Try to find blitz lib
|
||||
# Once done this will define
|
||||
#
|
||||
# BLITZ_FOUND - system has blitz lib
|
||||
# BLITZ_INCLUDES - the blitz include directory
|
||||
# BLITZ_LIBRARIES - The libraries needed to use blitz
|
||||
|
||||
# Copyright (c) 2006, Montel Laurent, <montel@kde.org>
|
||||
# Copyright (c) 2007, Allen Winter, <winter@kde.org>
|
||||
# Copyright (C) 2008 Gael Guennebaud <g.gael@free.fr>
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
# include(FindLibraryWithDebug)
|
||||
|
||||
if (BLITZ_INCLUDES AND BLITZ_LIBRARIES)
|
||||
set(Blitz_FIND_QUIETLY TRUE)
|
||||
endif (BLITZ_INCLUDES AND BLITZ_LIBRARIES)
|
||||
|
||||
find_path(BLITZ_INCLUDES
|
||||
NAMES
|
||||
blitz/array.h
|
||||
PATH_SUFFIXES blitz*
|
||||
PATHS
|
||||
$ENV{BLITZDIR}/include
|
||||
${INCLUDE_INSTALL_DIR}
|
||||
)
|
||||
|
||||
find_library(BLITZ_LIBRARIES
|
||||
blitz
|
||||
PATHS
|
||||
$ENV{BLITZDIR}/lib
|
||||
${LIB_INSTALL_DIR}
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Blitz DEFAULT_MSG
|
||||
BLITZ_INCLUDES BLITZ_LIBRARIES)
|
||||
|
||||
mark_as_advanced(BLITZ_INCLUDES BLITZ_LIBRARIES)
|
||||
34
bench/btl/cmake/FindCBLAS.cmake
Normal file
34
bench/btl/cmake/FindCBLAS.cmake
Normal file
@@ -0,0 +1,34 @@
|
||||
# include(FindLibraryWithDebug)
|
||||
|
||||
if (CBLAS_INCLUDES AND CBLAS_LIBRARIES)
|
||||
set(CBLAS_FIND_QUIETLY TRUE)
|
||||
endif (CBLAS_INCLUDES AND CBLAS_LIBRARIES)
|
||||
|
||||
find_path(CBLAS_INCLUDES
|
||||
NAMES
|
||||
cblas.h
|
||||
PATHS
|
||||
$ENV{CBLASDIR}/include
|
||||
${INCLUDE_INSTALL_DIR}
|
||||
)
|
||||
|
||||
find_library(CBLAS_LIBRARIES
|
||||
cblas
|
||||
PATHS
|
||||
$ENV{CBLASDIR}/lib
|
||||
${LIB_INSTALL_DIR}
|
||||
)
|
||||
|
||||
find_file(CBLAS_LIBRARIES
|
||||
libcblas.so.3
|
||||
PATHS
|
||||
/usr/lib
|
||||
$ENV{CBLASDIR}/lib
|
||||
${LIB_INSTALL_DIR}
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(CBLAS DEFAULT_MSG
|
||||
CBLAS_INCLUDES CBLAS_LIBRARIES)
|
||||
|
||||
mark_as_advanced(CBLAS_INCLUDES CBLAS_LIBRARIES)
|
||||
30
bench/btl/cmake/FindEigen.cmake
Normal file
30
bench/btl/cmake/FindEigen.cmake
Normal file
@@ -0,0 +1,30 @@
|
||||
# - Try to find eigen lib
|
||||
# Once done this will define
|
||||
#
|
||||
# EIGEN_FOUND - system has eigen lib
|
||||
# EIGEN_INCLUDE_DIR - the eigen include directory
|
||||
|
||||
# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
if (EIGEN_INCLUDE_DIR)
|
||||
|
||||
# in cache already
|
||||
set(EIGEN_FOUND TRUE)
|
||||
|
||||
else (EIGEN_INCLUDE_DIR)
|
||||
|
||||
find_path(EIGEN_INCLUDE_DIR NAMES eigen/matrix.h
|
||||
PATHS
|
||||
${INCLUDE_INSTALL_DIR}
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Eigen DEFAULT_MSG EIGEN_INCLUDE_DIR )
|
||||
|
||||
|
||||
mark_as_advanced(EIGEN_INCLUDE_DIR)
|
||||
|
||||
endif(EIGEN_INCLUDE_DIR)
|
||||
|
||||
32
bench/btl/cmake/FindEigen2.cmake
Normal file
32
bench/btl/cmake/FindEigen2.cmake
Normal file
@@ -0,0 +1,32 @@
|
||||
# - Try to find eigen2 headers
|
||||
# Once done this will define
|
||||
#
|
||||
# EIGEN2_FOUND - system has eigen2 lib
|
||||
# EIGEN2_INCLUDE_DIR - the eigen2 include directory
|
||||
#
|
||||
# Copyright (C) 2008 Gael Guennebaud <g.gael@free.fr>
|
||||
# Adapted from FindEigen.cmake:
|
||||
# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
if (EIGEN2_INCLUDE_DIR)
|
||||
|
||||
# in cache already
|
||||
set(EIGEN2_FOUND TRUE)
|
||||
|
||||
else (EIGEN2_INCLUDE_DIR)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Eigen2 DEFAULT_MSG EIGEN2_INCLUDE_DIR)
|
||||
|
||||
find_path(EIGEN2_INCLUDE_DIR NAMES Eigen/Core
|
||||
PATHS
|
||||
${Eigen_SOURCE_DIR}/
|
||||
${INCLUDE_INSTALL_DIR}
|
||||
)
|
||||
|
||||
mark_as_advanced(EIGEN2_INCLUDE_DIR)
|
||||
|
||||
endif(EIGEN2_INCLUDE_DIR)
|
||||
|
||||
17
bench/btl/cmake/FindGMM.cmake
Normal file
17
bench/btl/cmake/FindGMM.cmake
Normal file
@@ -0,0 +1,17 @@
|
||||
if (GMM_INCLUDE_DIR)
|
||||
# in cache already
|
||||
set(GMM_FOUND TRUE)
|
||||
else (GMM_INCLUDE_DIR)
|
||||
|
||||
find_path(GMM_INCLUDE_DIR NAMES gmm/gmm.h
|
||||
PATHS
|
||||
${INCLUDE_INSTALL_DIR}
|
||||
${GMM_INCLUDE_PATH}
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GMM DEFAULT_MSG GMM_INCLUDE_DIR )
|
||||
|
||||
mark_as_advanced(GMM_INCLUDE_DIR)
|
||||
|
||||
endif(GMM_INCLUDE_DIR)
|
||||
31
bench/btl/cmake/MacroOptionalAddSubdirectory.cmake
Normal file
31
bench/btl/cmake/MacroOptionalAddSubdirectory.cmake
Normal file
@@ -0,0 +1,31 @@
|
||||
# - MACRO_OPTIONAL_ADD_SUBDIRECTORY() combines ADD_SUBDIRECTORY() with an OPTION()
|
||||
# MACRO_OPTIONAL_ADD_SUBDIRECTORY( <dir> )
|
||||
# If you use MACRO_OPTIONAL_ADD_SUBDIRECTORY() instead of ADD_SUBDIRECTORY(),
|
||||
# this will have two effects
|
||||
# 1 - CMake will not complain if the directory doesn't exist
|
||||
# This makes sense if you want to distribute just one of the subdirs
|
||||
# in a source package, e.g. just one of the subdirs in kdeextragear.
|
||||
# 2 - If the directory exists, it will offer an option to skip the
|
||||
# subdirectory.
|
||||
# This is useful if you want to compile only a subset of all
|
||||
# directories.
|
||||
|
||||
# Copyright (c) 2007, Alexander Neundorf, <neundorf@kde.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
|
||||
MACRO (MACRO_OPTIONAL_ADD_SUBDIRECTORY _dir )
|
||||
GET_FILENAME_COMPONENT(_fullPath ${_dir} ABSOLUTE)
|
||||
IF(EXISTS ${_fullPath})
|
||||
IF(${ARGC} EQUAL 2)
|
||||
OPTION(BUILD_${_dir} "Build directory ${_dir}" ${ARGV1})
|
||||
ELSE(${ARGC} EQUAL 2)
|
||||
OPTION(BUILD_${_dir} "Build directory ${_dir}" TRUE)
|
||||
ENDIF(${ARGC} EQUAL 2)
|
||||
IF(BUILD_${_dir})
|
||||
ADD_SUBDIRECTORY(${_dir})
|
||||
ENDIF(BUILD_${_dir})
|
||||
ENDIF(EXISTS ${_fullPath})
|
||||
ENDMACRO (MACRO_OPTIONAL_ADD_SUBDIRECTORY)
|
||||
Reference in New Issue
Block a user