Skip to content

Commit bd533e0

Browse files
Artem Gindinsonjgu222
authored andcommitted
Do not include type_traits in RT helpers when using OCL Clang 15
In the MSVC environment, Clang 16 is the minimum required version to build some of the type traits-based assertions in RT helpers. This addresses one of the more recent LLVM 15 build compatibility issues. Co-authored-by: Junjie Gu <[email protected]>
1 parent 9dc92d3 commit bd533e0

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

IGC/AdaptorCommon/RayTracing/API/RayDispatchGlobalData.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*========================== begin_copyright_notice ============================
22
3-
Copyright (C) 2020-2021 Intel Corporation
3+
Copyright (C) 2020-2024 Intel Corporation
44
55
SPDX-License-Identifier: MIT
66
@@ -10,7 +10,13 @@ SPDX-License-Identifier: MIT
1010

1111
#include <stddef.h>
1212
#include <stdint.h>
13-
#if !defined(__clang__) || (__clang_major__ >= 15)
13+
#undef HAS_INCLUDE_TYPE_TRAITS
14+
#ifdef _MSC_VER
15+
#if !defined(__clang__) || (__clang_major__ >= 16)
16+
#define HAS_INCLUDE_TYPE_TRAITS
17+
#endif
18+
#endif // _MSC_VER
19+
#ifdef HAS_INCLUDE_TYPE_TRAITS
1420
#include <type_traits>
1521
#endif
1622

@@ -242,9 +248,9 @@ static_assert(RTStackAlign % RayDispatchGlobalData::StackChunkSize == 0, "no?");
242248

243249
static_assert(sizeof(RayDispatchGlobalData) == 176, "unexpected size?");
244250
static_assert(sizeof(RayDispatchGlobalData::RT::Xe) == sizeof(RayDispatchGlobalData), "unexpected size?");
245-
#if !defined(__clang__) || (__clang_major__ >= 15)
251+
#ifdef HAS_INCLUDE_TYPE_TRAITS
246252
static_assert(std::is_standard_layout<RayDispatchGlobalData>::value, "no?");
247-
#endif
253+
#endif // HAS_INCLUDE_TYPE_TRAITS
248254

249255
// This data is passed in as inline data into the raygeneration shader
250256
// by the UMD.

IGC/AdaptorCommon/RayTracing/RTStackFormat.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ SPDX-License-Identifier: MIT
1818

1919
#include <stdint.h>
2020
#include <stddef.h>
21-
#if !defined(__clang__) || (__clang_major__ >= 15)
22-
#include <type_traits>
23-
#endif
2421

2522

2623
// This code defines a set of macros, that allows us to intentionally disable certain warnings
@@ -644,10 +641,10 @@ using SMStack2 = SMStack<GenT, MAX_BVH_LEVELS>;
644641
template <typename RTStack2T>
645642
constexpr size_t sizeofRTStack2() { return sizeof(RTStack2T); }
646643

647-
#if !defined(__clang__) || (__clang_major__ >= 15)
644+
#ifdef HAS_INCLUDE_TYPE_TRAITS
648645
static_assert(std::is_standard_layout_v<RTStack2<Xe>>);
649646
static_assert(std::is_standard_layout_v<SMStack2<Xe>>);
650-
#endif
647+
#endif // HAS_INCLUDE_TYPE_TRAITS
651648

652649
// Makes sure that important fields are at their proper offset from the start
653650
// of the structure. Update this if the structure changes. This is just for

0 commit comments

Comments
 (0)