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