Skip to content

Commit 4151c91

Browse files
committed
Made oneDPL work with a modern DPC++ / old GCC combination.
Upgraded to the very latest version of oneDPL to make it compatible with the latest oneAPI / DPC++ versions. Updated the TBB build to make find_package(TBB) calls functional, so that the oneDPL build/configuration would find the TBB version built by the project. Moved the oneDPL includes at the beginning of the test source file, as they are very sensitive to include orders when using GCC 9 as it turns out.
1 parent 7ea740f commit 4151c91

File tree

4 files changed

+44
-9
lines changed

4 files changed

+44
-9
lines changed

extern/dpl/CMakeLists.txt

+10-3
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,20 @@ message( STATUS "Building oneDPL as part of the TRACCC project" )
1818

1919
# Declare where to get DPL from.
2020
set( TRACCC_DPL_SOURCE
21-
"URL;https://github.com/oneapi-src/oneDPL/archive/refs/tags/oneDPL-2022.0.0-release.tar.gz;URL_MD5;46b60bd87325042df716d1df4686eb3b"
21+
"URL;https://github.com/oneapi-src/oneDPL/archive/refs/tags/oneDPL-2022.2.0-rc1.tar.gz;URL_MD5;e63a3903873636b464db6ee7a9364055"
2222
CACHE STRING "Source for DPL, when built as part of this project" )
2323
mark_as_advanced( TRACCC_DPL_SOURCE )
2424
FetchContent_Declare( DPL ${TRACCC_DPL_SOURCE} )
2525

26-
# Exclude TBB
27-
set( ONEDPL_BACKEND dpcpp_only )
26+
# Set the default oneDPL threading backend.
27+
set( ONEDPL_BACKEND "dpcpp" CACHE STRING "oneDPL threading backend" )
2828

2929
# Get it into the current directory.
3030
FetchContent_MakeAvailable( DPL )
31+
32+
# Treat the oneDPL headers as "system headers", to avoid getting warnings from
33+
# them.
34+
get_target_property( _incDirs oneDPL INTERFACE_INCLUDE_DIRECTORIES )
35+
target_include_directories( oneDPL
36+
SYSTEM INTERFACE ${_incDirs} )
37+
unset( _incDirs )

extern/tbb/CMakeLists.txt

+20-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# TRACCC library, part of the ACTS project (R&D line)
22
#
3-
# (c) 2022 CERN for the benefit of the ACTS project
3+
# (c) 2022-2023 CERN for the benefit of the ACTS project
44
#
55
# Mozilla Public License Version 2.0
66

@@ -27,5 +27,23 @@ FetchContent_Declare( TBB ${TRACCC_TBB_SOURCE} )
2727
set( TBB_TEST FALSE CACHE BOOL "Turn off the TBB tests" )
2828
set( TBB_STRICT FALSE CACHE BOOL "Do not throw errors on compiler warnings" )
2929

30-
# Get it into the current directory.
30+
# Get it into the current directory. Setting TBB_DIR locally to an empty string
31+
# is necessary so that incremental rebuilds would not get confused about the
32+
# TBB_DIR cache variable set a little further down in this file. (The TBB CMake
33+
# configuration is plenty weird...)
34+
set( TBB_DIR "" )
3135
FetchContent_MakeAvailable( TBB )
36+
37+
# Make CMake pick up a no-op TBBConfig.cmake file in any possible
38+
# find_package(TBB) call. (Mostly needed in case other externals also need
39+
# TBB.)
40+
include( CMakePackageConfigHelpers )
41+
configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/TBBConfig.cmake.in"
42+
"${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TBBConfig.cmake"
43+
@ONLY )
44+
write_basic_package_version_file(
45+
"${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TBBConfig-version.cmake"
46+
VERSION "2021.7.0"
47+
COMPATIBILITY "AnyNewerVersion" )
48+
set( TBB_DIR "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}" CACHE PATH
49+
"TBBConfig.cmake location" )

extern/tbb/TBBConfig.cmake.in

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# TRACCC library, part of the ACTS project (R&D line)
2+
#
3+
# (c) 2023 CERN for the benefit of the ACTS project
4+
#
5+
# Mozilla Public License Version 2.0
6+
7+
# Dummy file for making find_package(TBB) calls a no-op when the TRACCC
8+
# project is building TBB itself.
9+
10+
message( "Woo Hoo!!!" )

tests/sycl/test_dpl.sycl

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
* Mozilla Public License Version 2.0
66
*/
77

8+
// DPL include(s).
9+
#include <oneapi/dpl/algorithm>
10+
#include <oneapi/dpl/execution>
11+
812
// SYCL include(s).
913
#include <CL/sycl.hpp>
1014

@@ -15,10 +19,6 @@
1519
#include <vecmem/memory/sycl/device_memory_resource.hpp>
1620
#include <vecmem/utils/sycl/copy.hpp>
1721

18-
// DPL include(s).
19-
#include <oneapi/dpl/algorithm>
20-
#include <oneapi/dpl/execution>
21-
2222
// GTest include(s).
2323
#include <gtest/gtest.h>
2424

0 commit comments

Comments
 (0)