From 032e98c2eca8f4ff3bf340a8c09e1951aa4fc63e Mon Sep 17 00:00:00 2001 From: Aurora Perego <84700885+AuroraPerego@users.noreply.github.com> Date: Wed, 28 Aug 2024 15:55:25 +0200 Subject: [PATCH] ignore -Wswitch-default when using clang (#2373) --- include/alpaka/platform/PlatformGenericSycl.hpp | 9 +++++++++ include/alpaka/workdiv/WorkDivHelpers.hpp | 9 +++++++++ test/unit/math/src/DataGen.hpp | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/include/alpaka/platform/PlatformGenericSycl.hpp b/include/alpaka/platform/PlatformGenericSycl.hpp index c4df17c6660a..7b6de28dc88f 100644 --- a/include/alpaka/platform/PlatformGenericSycl.hpp +++ b/include/alpaka/platform/PlatformGenericSycl.hpp @@ -20,6 +20,11 @@ #ifdef ALPAKA_ACC_SYCL_ENABLED +# if BOOST_COMP_CLANG +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wswitch-default" +# endif + # include namespace alpaka @@ -720,4 +725,8 @@ namespace alpaka::trait }; } // namespace alpaka::trait +# if BOOST_COMP_CLANG +# pragma clang diagnostic pop +# endif + #endif diff --git a/include/alpaka/workdiv/WorkDivHelpers.hpp b/include/alpaka/workdiv/WorkDivHelpers.hpp index 1f37c852577d..c15319cf6f7a 100644 --- a/include/alpaka/workdiv/WorkDivHelpers.hpp +++ b/include/alpaka/workdiv/WorkDivHelpers.hpp @@ -22,6 +22,11 @@ #include #include +#if BOOST_COMP_CLANG +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wswitch-default" +#endif + //! The alpaka library. namespace alpaka { @@ -543,3 +548,7 @@ namespace alpaka return isValidWorkDiv(workDiv, getAccDevProps(dev)); } } // namespace alpaka + +#if BOOST_COMP_CLANG +# pragma clang diagnostic pop +#endif diff --git a/test/unit/math/src/DataGen.hpp b/test/unit/math/src/DataGen.hpp index 78a5d0543a58..8b35cbee5fc5 100644 --- a/test/unit/math/src/DataGen.hpp +++ b/test/unit/math/src/DataGen.hpp @@ -11,6 +11,11 @@ #include #include +#if BOOST_COMP_CLANG +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wswitch-default" +#endif + namespace mathtest { //! Helper to generate random numbers of the given type for testing @@ -199,3 +204,7 @@ namespace mathtest } } } // namespace mathtest + +#if BOOST_COMP_CLANG +# pragma clang diagnostic pop +#endif