From 73eecfbc280445d13afa80bb2b74c708a8129e56 Mon Sep 17 00:00:00 2001 From: Rich Hornung Date: Fri, 19 Jul 2024 14:43:37 -0700 Subject: [PATCH 1/2] Handle different SYCL header include locations (borrowed from Umpire). --- include/RAJA/policy/sycl.hpp | 2 +- include/RAJA/policy/sycl/MemUtils_SYCL.hpp | 2 +- include/RAJA/policy/sycl/forall.hpp | 3 ++- include/RAJA/policy/sycl/policy.hpp | 2 +- include/RAJA/util/sycl_compat.hpp | 7 +++++++ 5 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 include/RAJA/util/sycl_compat.hpp diff --git a/include/RAJA/policy/sycl.hpp b/include/RAJA/policy/sycl.hpp index c6728579ba..491e39910c 100644 --- a/include/RAJA/policy/sycl.hpp +++ b/include/RAJA/policy/sycl.hpp @@ -24,7 +24,7 @@ #if defined(RAJA_SYCL_ACTIVE) -#include +#include "RAJA/util/sycl_compat.hpp" #include "RAJA/policy/sycl/forall.hpp" #include "RAJA/policy/sycl/policy.hpp" diff --git a/include/RAJA/policy/sycl/MemUtils_SYCL.hpp b/include/RAJA/policy/sycl/MemUtils_SYCL.hpp index c158bd2801..27d3209ae3 100644 --- a/include/RAJA/policy/sycl/MemUtils_SYCL.hpp +++ b/include/RAJA/policy/sycl/MemUtils_SYCL.hpp @@ -23,7 +23,7 @@ #if defined(RAJA_ENABLE_SYCL) -#include +#include "RAJA/util/sycl_compat.hpp" #include #include diff --git a/include/RAJA/policy/sycl/forall.hpp b/include/RAJA/policy/sycl/forall.hpp index 73ea4bf648..901cc694f0 100644 --- a/include/RAJA/policy/sycl/forall.hpp +++ b/include/RAJA/policy/sycl/forall.hpp @@ -26,10 +26,11 @@ #if defined(RAJA_ENABLE_SYCL) -#include #include #include +#include "RAJA/util/sycl_compat.hpp" + #include "RAJA/pattern/forall.hpp" #include "RAJA/pattern/params/forall.hpp" diff --git a/include/RAJA/policy/sycl/policy.hpp b/include/RAJA/policy/sycl/policy.hpp index b959f552e6..0f92fe27e1 100644 --- a/include/RAJA/policy/sycl/policy.hpp +++ b/include/RAJA/policy/sycl/policy.hpp @@ -22,7 +22,7 @@ #if defined(RAJA_SYCL_ACTIVE) -#include +#include "RAJA/util/sycl_compat.hpp" #include "RAJA/policy/PolicyBase.hpp" #include "RAJA/policy/sequential/policy.hpp" diff --git a/include/RAJA/util/sycl_compat.hpp b/include/RAJA/util/sycl_compat.hpp new file mode 100644 index 0000000000..b263fbdd69 --- /dev/null +++ b/include/RAJA/util/sycl_compat.hpp @@ -0,0 +1,7 @@ +#if (__INTEL_CLANG_COMPILER && __INTEL_CLANG_COMPILER < 20230000) +// older version, use legacy header locations +#include +#else +// SYCL 2020 standard header +#include +#endif From 72b8b19962917321500d21f3b32267c1a44ffb47 Mon Sep 17 00:00:00 2001 From: Rich Hornung Date: Fri, 19 Jul 2024 14:56:47 -0700 Subject: [PATCH 2/2] Add copyright header and include guard --- include/RAJA/util/sycl_compat.hpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/include/RAJA/util/sycl_compat.hpp b/include/RAJA/util/sycl_compat.hpp index b263fbdd69..7754caa273 100644 --- a/include/RAJA/util/sycl_compat.hpp +++ b/include/RAJA/util/sycl_compat.hpp @@ -1,3 +1,23 @@ +/*! + ****************************************************************************** + * + * \file + * + * \brief RAJA header file for handling different SYCL header include paths + * + ****************************************************************************** + */ + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// +// Copyright (c) 2016-24, Lawrence Livermore National Security, LLC +// and RAJA project contributors. See the RAJA/LICENSE file for details. +// +// SPDX-License-Identifier: (BSD-3-Clause) +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// + +#ifndef RAJA_util_sycl_compat_HPP +#define RAJA_util_sycl_compat_HPP + #if (__INTEL_CLANG_COMPILER && __INTEL_CLANG_COMPILER < 20230000) // older version, use legacy header locations #include @@ -5,3 +25,5 @@ // SYCL 2020 standard header #include #endif + +#endif // RAJA_util_sycl_compat_HPP