diff --git a/vtkm/cont/tbb/internal/CMakeLists.txt b/vtkm/cont/tbb/internal/CMakeLists.txt index bc9738f54..e525aba5b 100644 --- a/vtkm/cont/tbb/internal/CMakeLists.txt +++ b/vtkm/cont/tbb/internal/CMakeLists.txt @@ -22,7 +22,13 @@ set(headers ArrayManagerExecutionTBB.h DeviceAdapterAlgorithmTBB.h DeviceAdapterTagTBB.h - parallel_sort.h ) +if("${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR}" VERSION_LESS 4.3) + if("${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR}" VERSION_LESS 4.2) + message_error("VTK-m not tested with TBB before version 4.1. Please upgrade your TBB library.") + endif() + set(headers ${headers} parallel_sort.h) +endif() + vtkm_declare_headers(${headers}) diff --git a/vtkm/cont/tbb/internal/DeviceAdapterAlgorithmTBB.h b/vtkm/cont/tbb/internal/DeviceAdapterAlgorithmTBB.h index ecc8d819c..4b3439c92 100644 --- a/vtkm/cont/tbb/internal/DeviceAdapterAlgorithmTBB.h +++ b/vtkm/cont/tbb/internal/DeviceAdapterAlgorithmTBB.h @@ -52,10 +52,15 @@ VTKM_BOOST_POST_INCLUDE #define NOMINMAX #endif +#include +#if (TBB_VERSION_MAJOR == 4) && (TBB_VERSION_MINOR == 2) //we provide an patched implementation of tbb parallel_sort //that fixes ADL for std::swap. This patch has been submitted to Intel -//and should be included in future version of TBB. +//and is fixed in TBB 4.2 update 2. #include +#else +#include +#endif #include #include