Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix several SYCL, OneDPL, and Kokkos build issues #821

Merged
merged 1 commit into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,22 @@ option( TRACCC_USE_SYSTEM_DPL
${TRACCC_USE_SYSTEM_LIBS} )
if( TRACCC_SETUP_DPL )
if( TRACCC_USE_SYSTEM_DPL )
find_package( DPL REQUIRED )
# OneDPL determines whether SYCL is supported by asking the C++ compiler
# rather than the SYCL compiler, as a dedicated SYCL compiler is a non-
# standard traccc idea. To override the default behaviour (i.e. OneDPL
# testing the C++ compiler and finding that it does _not_ support SYCL)
# we simply override the support flags. This is fragile, as the flags
# are internal to OneDPL, but it's the best we can do. Note thr flag was
# renamed in https://github.com/uxlfoundation/oneDPL/pull/1949.
set(_sycl_support ON)
set(SYCL_SUPPORT ON)
find_package( oneDPL REQUIRED )
# OneDPL attaches the `-fsycl` flag to the C++ compiler, which causes
# it to incorrectly trigger some preprocessor definitions, thereby
# loading SYCL-specific header files which do not exist for e.g. a
# generic clang installation. Therefore, we have to manually wipe the
# compile flags that OneDPL sets.
set_target_properties(oneDPL PROPERTIES INTERFACE_COMPILE_OPTIONS "")
else()
add_subdirectory( extern/dpl )
endif()
Expand All @@ -220,6 +235,12 @@ option( TRACCC_USE_SYSTEM_KOKKOS
if( TRACCC_SETUP_KOKKOS )
if( TRACCC_USE_SYSTEM_KOKKOS )
find_package( Kokkos REQUIRED )
# Kokkos likes to determine the host architecture at installation time
# and propagate the corresponding `-march` flag through the CMake
# configuration which cases compiler errors when we use e.g. ICPX which
# dislikes it when you set two different microarchitectures (traccc sets
# a generic x86 target).
set_target_properties(Kokkos::kokkoscore PROPERTIES INTERFACE_COMPILE_OPTIONS "")
else()
add_subdirectory( extern/kokkos )
endif()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,16 @@
#include "traccc/sycl/clusterization/measurement_sorting_algorithm.hpp"

// oneDPL include(s).
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wshadow"
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wshorten-64-to-32"
#pragma clang diagnostic ignored "-Wsign-conversion"
#pragma clang diagnostic ignored "-Wimplicit-int-conversion"
#pragma clang diagnostic ignored "-Wsign-compare"
#include <oneapi/dpl/algorithm>
#include <oneapi/dpl/execution>
#pragma clang diagnostic pop

// SYCL include(s).
#include <sycl/sycl.hpp>
Expand Down
9 changes: 9 additions & 0 deletions device/sycl/src/finding/find_tracks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,17 @@
#include <vecmem/utils/sycl/local_accessor.hpp>

// oneDPL include(s).
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wshadow"
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wshorten-64-to-32"
#pragma clang diagnostic ignored "-Wsign-conversion"
#pragma clang diagnostic ignored "-Wimplicit-int-conversion"
#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
#pragma clang diagnostic ignored "-Wsign-compare"
#include <oneapi/dpl/algorithm>
#include <oneapi/dpl/execution>
#pragma clang diagnostic pop

// SYCL include(s).
#include <sycl/sycl.hpp>
Expand Down
9 changes: 9 additions & 0 deletions device/sycl/src/fitting/fit_tracks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,17 @@
#include <vecmem/utils/copy.hpp>

// oneDPL include(s).
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wshadow"
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wshorten-64-to-32"
#pragma clang diagnostic ignored "-Wsign-conversion"
#pragma clang diagnostic ignored "-Wimplicit-int-conversion"
#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
#pragma clang diagnostic ignored "-Wsign-compare"
#include <oneapi/dpl/algorithm>
#include <oneapi/dpl/execution>
#pragma clang diagnostic pop

// SYCL include(s).
#include <sycl/sycl.hpp>
Expand Down
10 changes: 10 additions & 0 deletions tests/sycl/test_dpl.sycl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,18 @@
*/

// DPL include(s).
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wshadow"
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wshorten-64-to-32"
#pragma clang diagnostic ignored "-Wsign-conversion"
#pragma clang diagnostic ignored "-Wimplicit-int-conversion"
#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
#pragma clang diagnostic ignored "-Wdeprecated-copy-with-user-provided-copy"
#pragma clang diagnostic ignored "-Wsign-compare"
#include <oneapi/dpl/algorithm>
#include <oneapi/dpl/execution>
#pragma clang diagnostic pop

// SYCL include(s).
#include <sycl/sycl.hpp>
Expand Down
Loading