Skip to content

Commit 8f43cee

Browse files
author
Sergey Kanaev
committed
[SYCL][NFC] Align TryToGetNumElements and is_same_vector_size_impl definition and declaration to avoid compiler warnings
Compiling user code with -Wall provides compilation warnings from SYCL headers. In some cases (-Werror or smth like that is enabled) it may not allow to compile user code. ``` CL/sycl/detail/generic_type_traits.hpp:468:1: warning: 'TryToGetNumElements' defined as a struct template here but previously declared as a class template; this is valid, but may result in linker errors under the Microsoft C++ ABI [-Wmismatched-tags] struct TryToGetNumElements< ``` Signed-off-by: Sergey Kanaev <[email protected]>
1 parent 33f6ea4 commit 8f43cee

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sycl/include/CL/sycl/detail/generic_type_traits.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ using common_rel_ret_t =
462462
template <int N> struct Boolean;
463463

464464
// Try to get vector element count or 1 otherwise
465-
template <typename T, typename Enable = void> class TryToGetNumElements;
465+
template <typename T, typename Enable = void> struct TryToGetNumElements;
466466

467467
template <typename T>
468468
struct TryToGetNumElements<
@@ -561,7 +561,8 @@ template <typename T> static constexpr T quiet_NaN() {
561561
template <int FirstSize, typename... Args> struct is_same_vector_size_impl;
562562

563563
template <int FirstSize, typename T, typename... Args>
564-
class is_same_vector_size_impl<FirstSize, T, Args...> {
564+
struct is_same_vector_size_impl<FirstSize, T, Args...> {
565+
private:
565566
using CurrentT = detail::remove_pointer_t<T>;
566567
static constexpr int Size = vector_size<CurrentT>::value;
567568
static constexpr bool IsSizeEqual = (Size == FirstSize);

0 commit comments

Comments
 (0)