From 2a8920aeef0017b02ef8d071514b5f067f43e027 Mon Sep 17 00:00:00 2001 From: PBerger Date: Thu, 18 Apr 2013 15:33:56 +0200 Subject: [PATCH] Updated CMakeLists.txt, added an option for Intel TBB Edited gmm_blas.h, reordered includes --- CMakeLists.txt | 6 ++++++ resources/3rdparty/gmm-4.2/include/gmm/gmm_blas.h | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 86e28920b..54d9450de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,6 +48,7 @@ message(STATUS "GMMXX_INCLUDE_DIR is ${GMMXX_INCLUDE_DIR}") option(DEBUG "Sets whether the DEBUG mode is used" ON) option(USE_POPCNT "Sets whether the popcnt instruction is going to be used." ON) option(USE_BOOST_STATIC_LIBRARIES "Sets whether the Boost libraries should be linked statically." ON) +option(USE_INTELTBB "Sets whether the Intel TBB Extensions should be used." OFF) # If the DEBUG option was turned on, we will target a debug version and a release version otherwise if (DEBUG) @@ -155,6 +156,11 @@ endif(Boost_FOUND) # Intels Thread Building Blocks if (TBB_FOUND) message(STATUS "Found TBB with Interface Version ${TBB_INTERFACE_VERSION}") + + if(USE_INTELTBB) + add_definitions(-DGMM_USE_TBB) + endif() + include_directories(${TBB_INCLUDE_DIRS}) link_directories(${TBB_LIBRARY_DIRS}) endif(TBB_FOUND) diff --git a/resources/3rdparty/gmm-4.2/include/gmm/gmm_blas.h b/resources/3rdparty/gmm-4.2/include/gmm/gmm_blas.h index b13777917..249ae5efb 100644 --- a/resources/3rdparty/gmm-4.2/include/gmm/gmm_blas.h +++ b/resources/3rdparty/gmm-4.2/include/gmm/gmm_blas.h @@ -38,6 +38,13 @@ #ifndef GMM_BLAS_H__ #define GMM_BLAS_H__ +#ifdef GMM_USE_TBB +# include // This fixes a potential dependency ordering problem between GMM and TBB +# include "tbb/tbb.h" +# include +#endif + + #include "gmm_scaled.h" #include "gmm_transposed.h" #include "gmm_conjugated.h" @@ -395,8 +402,6 @@ namespace gmm { } #ifdef GMM_USE_TBB -#include "tbb/tbb.h" -#include /* Official Intel Hint on blocked_range vs. linear iterators: http://software.intel.com/en-us/forums/topic/289505 */