28 #ifndef HIP_VECTOR_TYPES_H
29 #define HIP_VECTOR_TYPES_H
31 #if defined (__HCC__) && (__hcc_workweek__ < 16032)
32 #error("This version of HIP requires a newer version of HCC.");
36 #include <hc_short_vector.hpp>
38 using namespace hc::short_vector;
43 typedef hc::short_vector::char1 char1;
44 typedef hc::short_vector::char2 char2;
45 typedef hc::short_vector::char3 char3;
46 typedef hc::short_vector::char4 char4;
49 typedef hc::short_vector::short1 short1;
50 typedef hc::short_vector::short2 short2;
51 typedef hc::short_vector::short3 short3;
52 typedef hc::short_vector::short4 short4;
55 typedef hc::short_vector::int1 int1;
56 typedef hc::short_vector::int2 int2;
57 typedef hc::short_vector::int3 int3;
58 typedef hc::short_vector::int4 int4;
61 typedef hc::short_vector::long1 long1;
62 typedef hc::short_vector::long2 long2;
63 typedef hc::short_vector::long3 long3;
64 typedef hc::short_vector::long4 long4;
67 typedef hc::short_vector::longlong1 longlong1;
68 typedef hc::short_vector::longlong2 longlong2;
69 typedef hc::short_vector::longlong3 longlong3;
70 typedef hc::short_vector::longlong4 longlong4;
75 typedef hc::short_vector::uchar1 uchar1;
76 typedef hc::short_vector::uchar2 uchar2;
77 typedef hc::short_vector::uchar3 uchar3;
78 typedef hc::short_vector::uchar4 uchar4;
81 typedef hc::short_vector::ushort1 ushort1;
82 typedef hc::short_vector::ushort2 ushort2;
83 typedef hc::short_vector::ushort3 ushort3;
84 typedef hc::short_vector::ushort4 ushort4;
87 typedef hc::short_vector::uint1 uint1;
88 typedef hc::short_vector::uint2 uint2;
89 typedef hc::short_vector::uint3 uint3;
90 typedef hc::short_vector::uint4 uint4;
93 typedef hc::short_vector::ulong1 ulong1;
94 typedef hc::short_vector::ulong2 ulong2;
95 typedef hc::short_vector::ulong3 ulong3;
96 typedef hc::short_vector::ulong4 ulong4;
99 typedef hc::short_vector::ulonglong1 ulonglong1;
100 typedef hc::short_vector::ulonglong2 ulonglong2;
101 typedef hc::short_vector::ulonglong3 ulonglong3;
102 typedef hc::short_vector::ulonglong4 ulonglong4;
107 typedef hc::short_vector::float1 float1;
108 typedef hc::short_vector::float2 float2;
109 typedef hc::short_vector::float3 float3;
110 typedef hc::short_vector::float4 float4;
113 typedef hc::short_vector::double1 double1;
114 typedef hc::short_vector::double2 double2;
115 typedef hc::short_vector::double3 double3;
116 typedef hc::short_vector::double4 double4;
121 #define ONE_COMPONENT_ACCESS(T, VT) inline VT make_ ##VT (T x) { VT t; t.x = x; return t; };
122 #define TWO_COMPONENT_ACCESS(T, VT) inline VT make_ ##VT (T x, T y) { VT t; t.x=x; t.y=y; return t; };
123 #define THREE_COMPONENT_ACCESS(T, VT) inline VT make_ ##VT (T x, T y, T z) { VT t; t.x=x; t.y=y; t.z=z; return t; };
124 #define FOUR_COMPONENT_ACCESS(T, VT) inline VT make_ ##VT (T x, T y, T z, T w) { VT t; t.x=x; t.y=y; t.z=z; t.w=w; return t; };
129 TWO_COMPONENT_ACCESS (
signed char, char2);
130 THREE_COMPONENT_ACCESS(
signed char, char3);
131 FOUR_COMPONENT_ACCESS (
signed char, char4);
134 TWO_COMPONENT_ACCESS (
short, short2);
135 THREE_COMPONENT_ACCESS(
short, short3);
136 FOUR_COMPONENT_ACCESS (
short, short4);
139 TWO_COMPONENT_ACCESS (
int, int2);
140 THREE_COMPONENT_ACCESS(
int, int3);
141 FOUR_COMPONENT_ACCESS (
int, int4);
144 TWO_COMPONENT_ACCESS (
long int, long2);
145 THREE_COMPONENT_ACCESS(
long int, long3);
146 FOUR_COMPONENT_ACCESS (
long int, long4);
149 TWO_COMPONENT_ACCESS (
long long int, ulong2);
150 THREE_COMPONENT_ACCESS(
long long int, ulong3);
151 FOUR_COMPONENT_ACCESS (
long long int, ulong4);
154 TWO_COMPONENT_ACCESS (
long long int, longlong2);
155 THREE_COMPONENT_ACCESS(
long long int, longlong3);
156 FOUR_COMPONENT_ACCESS (
long long int, longlong4);
161 TWO_COMPONENT_ACCESS (
unsigned char, uchar2);
162 THREE_COMPONENT_ACCESS(
unsigned char, uchar3);
163 FOUR_COMPONENT_ACCESS (
unsigned char, uchar4);
166 TWO_COMPONENT_ACCESS (
unsigned short, ushort2);
167 THREE_COMPONENT_ACCESS(
unsigned short, ushort3);
168 FOUR_COMPONENT_ACCESS (
unsigned short, ushort4);
171 TWO_COMPONENT_ACCESS (
unsigned int, uint2);
172 THREE_COMPONENT_ACCESS(
unsigned int, uint3);
173 FOUR_COMPONENT_ACCESS (
unsigned int, uint4);
176 TWO_COMPONENT_ACCESS (
unsigned long int, ulong2);
177 THREE_COMPONENT_ACCESS(
unsigned long int, ulong3);
178 FOUR_COMPONENT_ACCESS (
unsigned long int, ulong4);
181 TWO_COMPONENT_ACCESS (
unsigned long long int, ulong2);
182 THREE_COMPONENT_ACCESS(
unsigned long long int, ulong3);
183 FOUR_COMPONENT_ACCESS (
unsigned long long int, ulong4);
186 TWO_COMPONENT_ACCESS (
unsigned long long int, ulonglong2);
187 THREE_COMPONENT_ACCESS(
unsigned long long int, ulonglong3);
188 FOUR_COMPONENT_ACCESS (
unsigned long long int, ulonglong4);
193 TWO_COMPONENT_ACCESS (
float, float2);
194 THREE_COMPONENT_ACCESS(
float, float3);
195 FOUR_COMPONENT_ACCESS (
float, float4);
198 TWO_COMPONENT_ACCESS (
double, double2);
199 THREE_COMPONENT_ACCESS(
double, double3);
200 FOUR_COMPONENT_ACCESS (
double, double4);
#define ONE_COMPONENT_ACCESS(T, VT)
Definition: hip_vector_types.h:121