Skip to content

Commit 92471f8

Browse files
[SYCL] Remove std header inclusion from kernel_desc.hpp and use template proxy for int64_t (#6444)
1 parent f4f83d9 commit 92471f8

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

sycl/include/sycl/detail/kernel_desc.hpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
#include <sycl/detail/defines_elementary.hpp>
1414
#include <sycl/detail/export.hpp>
1515

16-
#include <cstdint>
17-
1816
__SYCL_INLINE_NAMESPACE(cl) {
1917
namespace sycl {
2018
namespace detail {
@@ -23,6 +21,18 @@ namespace detail {
2321
#define _Bool bool
2422
#endif
2523

24+
// As stated above, this header file cannot include any of the standard C++
25+
// headers. We need int64_t. Here we are matching the exact definition used by
26+
// the SemaSYCL version of kernel_desc.hpp in the FE.
27+
template <bool Cond, typename TrueT, typename FalseT> struct conditional {
28+
using type = TrueT;
29+
};
30+
template <typename TrueT, typename FalseT>
31+
struct conditional<false, TrueT, FalseT> {
32+
using type = FalseT;
33+
};
34+
using int64_t = conditional<sizeof(long) == 8, long, long long>::type;
35+
2636
// kernel parameter kinds
2737
enum class kernel_param_kind_t {
2838
kind_accessor = 0,

0 commit comments

Comments
 (0)