File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414 - os : ubuntu-22.04
1515 - os : ubuntu-22.04
1616 parallelisation : ' openmp'
17+ - os : ubuntu-22.04
18+ parallelisation : ' stdpar'
1719 env :
1820 BUILD_TYPE : Release
1921 CMAKE_FLAGS : >
3335 sudo apt-get update
3436 sudo apt-get install -y xorg-dev libglu1-mesa-dev libgtk-3-dev
3537
38+ - name : Install oneapiTBB package
39+ if : matrix.os == 'ubuntu-22.04' && matrix.parallelisation == 'stdpar'
40+ run : |
41+ curl https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | sudo gpg --dearmor -o /usr/share/keyrings/oneapi-archive-keyring.gpg
42+ echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
43+ sudo apt-get update
44+ sudo apt-get install -y intel-oneapi-tbb-devel
45+
3646 - uses : actions/setup-python@v5
3747 with :
3848 python-version : ' 3.x'
5969 -DSPIRIT_USE_OPENMP=ON
6070 $CMAKE_FLAGS
6171
72+ - name : Configure with STL parallelisation
73+ if : matrix.parallelisation == 'stdpar'
74+ shell : bash
75+ working-directory : ${{runner.workspace}}/build
76+ run : >
77+ cmake $GITHUB_WORKSPACE
78+ $BUILD_SYSTEM_FLAG
79+ -DCMAKE_BUILD_TYPE=$BUILD_TYPE
80+ $CMAKE_FLAGS
81+ -DSPIRIT_USE_STDPAR=ON
82+
6283 - name : Build
6384 shell : bash
6485 working-directory : ${{runner.workspace}}/build
Load diff This file was deleted.
Original file line number Diff line number Diff line change @@ -232,14 +232,34 @@ endif()
232232
233233######### TBB decisions ############################################
234234if ( SPIRIT_USE_STDPAR )
235- include ( FindTBB )
235+ # Try to find TBB module
236+ find_package ( TBB )
236237 if ( TBB_FOUND )
237- set ( SPIRIT_COMPILE_DEFINITIONS ${SPIRIT_COMPILE_DEFINITIONS} -DSPIRIT_USE_STDPAR )
238+ set ( TBB_LIB TBB::tbb )
238239 message ( STATUS ">> using TBB for parallel STL" )
239240 else ()
241+ set ( TBB_LIB )
240242 message ( WARNING ">> TBB could not be found." )
241- set ( SPIRIT_USE_STDPAR OFF )
242243 endif ()
244+ # All of these symbols are required to use this feature.
245+ # So, if this compiles even if TBB was not found it should be fine.
246+ list ( APPEND CMAKE_REQUIRED_LIBRARIES ${TBB_LIB} )
247+ include (CheckCXXSourceCompiles )
248+ check_cxx_source_compiles ("
249+ #include <execution>
250+ int main()
251+ {
252+ (void)std::execution::seq;
253+ (void)std::execution::par;
254+ (void)std::execution::par_unseq;
255+ return 0;
256+ }
257+ " HAVE_CXX17_PARALLEL_ALGORITHM )
258+
259+ if ( NOT HAVE_CXX17_PARALLEL_ALGORITHM )
260+ message ( FATAL_ERROR "C++17 execution policies are required for SPIRIT_USE_STDPAR=ON" )
261+ endif ()
262+ set ( SPIRIT_COMPILE_DEFINITIONS ${SPIRIT_COMPILE_DEFINITIONS} -DSPIRIT_USE_STDPAR )
243263endif ()
244264######### TBB decisions ############################################
245265
You can’t perform that action at this time.
0 commit comments