28#ifndef HIP_INCLUDE_HIP_AMD_DETAIL_HOST_DEFINES_H
29#define HIP_INCLUDE_HIP_AMD_DETAIL_HOST_DEFINES_H
33#define HIP_INCLUDE_HIP_HCC_DETAIL_HOST_DEFINES_H
36#ifndef GENERIC_GRID_LAUNCH
37#define GENERIC_GRID_LAUNCH 1
40#if defined(__clang__) && defined(__HIP__)
42namespace __hip_internal {
43typedef unsigned char uint8_t;
44typedef unsigned short uint16_t;
45typedef unsigned int uint32_t;
46typedef unsigned long long uint64_t;
47typedef signed char int8_t;
48typedef signed short int16_t;
49typedef signed int int32_t;
50typedef signed long long int64_t;
52template <
class _Tp, _Tp __v>
struct integral_constant {
53 static constexpr const _Tp value = __v;
54 typedef _Tp value_type;
55 typedef integral_constant type;
56 constexpr operator value_type()
const {
return value; }
57 constexpr value_type operator()()
const {
return value; }
59template <
class _Tp, _Tp __v>
constexpr const _Tp integral_constant<_Tp, __v>::value;
61typedef integral_constant<bool, true> true_type;
62typedef integral_constant<bool, false> false_type;
64template <
bool B>
using bool_constant = integral_constant<bool, B>;
65typedef bool_constant<true> true_type;
66typedef bool_constant<false> false_type;
68template <
bool __B,
class __T =
void>
struct enable_if {};
69template <
class __T>
struct enable_if<true, __T> {
typedef __T type; };
71template<
bool _B>
struct true_or_false_type :
public false_type {};
72template<>
struct true_or_false_type<true> :
public true_type {};
74template <
class _Tp>
struct is_integral :
public false_type {};
75template <>
struct is_integral<bool> :
public true_type {};
76template <>
struct is_integral<char> :
public true_type {};
77template <>
struct is_integral<signed char> :
public true_type {};
78template <>
struct is_integral<unsigned char> :
public true_type {};
79template <>
struct is_integral<wchar_t> :
public true_type {};
80template <>
struct is_integral<short> :
public true_type {};
81template <>
struct is_integral<unsigned short> :
public true_type {};
82template <>
struct is_integral<int> :
public true_type {};
83template <>
struct is_integral<unsigned int> :
public true_type {};
84template <>
struct is_integral<long> :
public true_type {};
85template <>
struct is_integral<unsigned long> :
public true_type {};
86template <>
struct is_integral<long long> :
public true_type {};
87template <>
struct is_integral<unsigned long long> :
public true_type {};
89template <
class _Tp>
struct is_arithmetic :
public false_type {};
90template <>
struct is_arithmetic<bool> :
public true_type {};
91template <>
struct is_arithmetic<char> :
public true_type {};
92template <>
struct is_arithmetic<signed char> :
public true_type {};
93template <>
struct is_arithmetic<unsigned char> :
public true_type {};
94template <>
struct is_arithmetic<wchar_t> :
public true_type {};
95template <>
struct is_arithmetic<short> :
public true_type {};
96template <>
struct is_arithmetic<unsigned short> :
public true_type {};
97template <>
struct is_arithmetic<int> :
public true_type {};
98template <>
struct is_arithmetic<unsigned int> :
public true_type {};
99template <>
struct is_arithmetic<long> :
public true_type {};
100template <>
struct is_arithmetic<unsigned long> :
public true_type {};
101template <>
struct is_arithmetic<long long> :
public true_type {};
102template <>
struct is_arithmetic<unsigned long long> :
public true_type {};
103template <>
struct is_arithmetic<float> :
public true_type {};
104template <>
struct is_arithmetic<double> :
public true_type {};
106template<
typename _Tp>
struct is_floating_point :
public false_type {};
107template<>
struct is_floating_point<float> :
public true_type {};
108template<>
struct is_floating_point<double> :
public true_type {};
109template<>
struct is_floating_point<long double> :
public true_type {};
111template <
typename __T,
typename __U>
struct is_same :
public false_type {};
112template <
typename __T>
struct is_same<__T, __T> :
public true_type {};
114template<typename _Tp, bool = is_arithmetic<_Tp>::value>
115 struct is_signed :
public false_type {};
116template<
typename _Tp>
117 struct is_signed<_Tp, true> :
public true_or_false_type<_Tp(-1) < _Tp(0)> {};
119template<typename _CharT> struct char_traits;
120template<typename _CharT, typename _Traits = char_traits<_CharT>> class basic_istream;
121template<typename _CharT, typename _Traits = char_traits<_CharT>> class basic_ostream;
122typedef basic_istream<char> istream;
123typedef basic_ostream<char> ostream;
125template<typename _Tp>
126 struct is_standard_layout
127 : public integral_constant<bool, __is_standard_layout(_Tp)>
130template<typename _Tp>
132 : public integral_constant<bool, __is_trivial(_Tp)>
135typedef __hip_internal::uint8_t __hip_uint8_t;
136typedef __hip_internal::uint16_t __hip_uint16_t;
137typedef __hip_internal::uint32_t __hip_uint32_t;
138typedef __hip_internal::uint64_t __hip_uint64_t;
139typedef __hip_internal::int8_t __hip_int8_t;
140typedef __hip_internal::int16_t __hip_int16_t;
141typedef __hip_internal::int32_t __hip_int32_t;
142typedef __hip_internal::int64_t __hip_int64_t;
144#if !__CLANG_HIP_RUNTIME_WRAPPER_INCLUDED__
145#define __host__ __attribute__((host))
146#define __device__ __attribute__((device))
147#define __global__ __attribute__((global))
148#define __shared__ __attribute__((shared))
149#define __constant__ __attribute__((constant))
152#if !defined(__has_feature) || !__has_feature(cuda_noinline_keyword)
153#define __noinline__ __attribute__((noinline))
156#define __forceinline__ inline __attribute__((always_inline))
158#if __HIP_NO_IMAGE_SUPPORT
159#define __hip_img_chk__ __attribute__((unavailable("The image/texture API not supported on the device")))
161#define __hip_img_chk__
176#define __forceinline__ inline
181#define __hip_img_chk__