@@ -72,3 +72,172 @@ extern "C" cudaError_t cudaLaunchKernel_ptsz(const void *func, dim3 gridDim,
7272#endif
7373
7474extern " C" __device__ int printf (const char *, ...);
75+
76+ struct char1 {
77+ char x;
78+ __host__ __device__ char1 (char x = 0 ) : x(x) {}
79+ };
80+ struct char2 {
81+ char x, y;
82+ __host__ __device__ char2 (char x = 0 , char y = 0 ) : x(x), y(y) {}
83+ };
84+ struct char4 {
85+ char x, y, z, w;
86+ __host__ __device__ char4 (char x = 0 , char y = 0 , char z = 0 , char w = 0 ) : x(x), y(y), z(z), w(w) {}
87+ };
88+
89+ struct uchar1 {
90+ unsigned char x;
91+ __host__ __device__ uchar1 (unsigned char x = 0 ) : x(x) {}
92+ };
93+ struct uchar2 {
94+ unsigned char x, y;
95+ __host__ __device__ uchar2 (unsigned char x = 0 , unsigned char y = 0 ) : x(x), y(y) {}
96+ };
97+ struct uchar4 {
98+ unsigned char x, y, z, w;
99+ __host__ __device__ uchar4 (unsigned char x = 0 , unsigned char y = 0 , unsigned char z = 0 , unsigned char w = 0 ) : x(x), y(y), z(z), w(w) {}
100+ };
101+
102+ struct short1 {
103+ short x;
104+ __host__ __device__ short1 (short x = 0 ) : x(x) {}
105+ };
106+ struct short2 {
107+ short x, y;
108+ __host__ __device__ short2 (short x = 0 , short y = 0 ) : x(x), y(y) {}
109+ };
110+ struct short4 {
111+ short x, y, z, w;
112+ __host__ __device__ short4 (short x = 0 , short y = 0 , short z = 0 , short w = 0 ) : x(x), y(y), z(z), w(w) {}
113+ };
114+
115+ struct ushort1 {
116+ unsigned short x;
117+ __host__ __device__ ushort1 (unsigned short x = 0 ) : x(x) {}
118+ };
119+ struct ushort2 {
120+ unsigned short x, y;
121+ __host__ __device__ ushort2 (unsigned short x = 0 , unsigned short y = 0 ) : x(x), y(y) {}
122+ };
123+ struct ushort4 {
124+ unsigned short x, y, z, w;
125+ __host__ __device__ ushort4 (unsigned short x = 0 , unsigned short y = 0 , unsigned short z = 0 , unsigned short w = 0 ) : x(x), y(y), z(z), w(w) {}
126+ };
127+
128+ struct int1 {
129+ int x;
130+ __host__ __device__ int1 (int x = 0 ) : x(x) {}
131+ };
132+ struct int2 {
133+ int x, y;
134+ __host__ __device__ int2 (int x = 0 , int y = 0 ) : x(x), y(y) {}
135+ };
136+ struct int4 {
137+ int x, y, z, w;
138+ __host__ __device__ int4 (int x = 0 , int y = 0 , int z = 0 , int w = 0 ) : x(x), y(y), z(z), w(w) {}
139+ };
140+
141+ struct uint1 {
142+ unsigned x;
143+ __host__ __device__ uint1 (unsigned x = 0 ) : x(x) {}
144+ };
145+ struct uint2 {
146+ unsigned x, y;
147+ __host__ __device__ uint2 (unsigned x = 0 , unsigned y = 0 ) : x(x), y(y) {}
148+ };
149+ struct uint3 {
150+ unsigned x, y, z;
151+ __host__ __device__ uint3 (unsigned x = 0 , unsigned y = 0 , unsigned z = 0 ) : x(x), y(y), z(z) {}
152+ };
153+ struct uint4 {
154+ unsigned x, y, z, w;
155+ __host__ __device__ uint4 (unsigned x = 0 , unsigned y = 0 , unsigned z = 0 , unsigned w = 0 ) : x(x), y(y), z(z), w(w) {}
156+ };
157+
158+ struct longlong1 {
159+ long long x;
160+ __host__ __device__ longlong1 (long long x = 0 ) : x(x) {}
161+ };
162+ struct longlong2 {
163+ long long x, y;
164+ __host__ __device__ longlong2 (long long x = 0 , long long y = 0 ) : x(x), y(y) {}
165+ };
166+ struct longlong4 {
167+ long long x, y, z, w;
168+ __host__ __device__ longlong4 (long long x = 0 , long long y = 0 , long long z = 0 , long long w = 0 ) : x(x), y(y), z(z), w(w) {}
169+ };
170+
171+ struct ulonglong1 {
172+ unsigned long long x;
173+ __host__ __device__ ulonglong1 (unsigned long long x = 0 ) : x(x) {}
174+ };
175+ struct ulonglong2 {
176+ unsigned long long x, y;
177+ __host__ __device__ ulonglong2 (unsigned long long x = 0 , unsigned long long y = 0 ) : x(x), y(y) {}
178+ };
179+ struct ulonglong4 {
180+ unsigned long long x, y, z, w;
181+ __host__ __device__ ulonglong4 (unsigned long long x = 0 , unsigned long long y = 0 , unsigned long long z = 0 , unsigned long long w = 0 ) : x(x), y(y), z(z), w(w) {}
182+ };
183+
184+ struct float1 {
185+ float x;
186+ __host__ __device__ float1 (float x = 0 ) : x(x) {}
187+ };
188+ struct float2 {
189+ float x, y;
190+ __host__ __device__ float2 (float x = 0 , float y = 0 ) : x(x), y(y) {}
191+ };
192+ struct float4 {
193+ float x, y, z, w;
194+ __host__ __device__ float4 (float x = 0 , float y = 0 , float z = 0 , float w = 0 ) : x(x), y(y), z(z), w(w) {}
195+ };
196+
197+ struct double1 {
198+ double x;
199+ __host__ __device__ double1 (double x = 0 ) : x(x) {}
200+ };
201+ struct double2 {
202+ double x, y;
203+ __host__ __device__ double2 (double x = 0 , double y = 0 ) : x(x), y(y) {}
204+ };
205+ struct double4 {
206+ double x, y, z, w;
207+ __host__ __device__ double4 (double x = 0 , double y = 0 , double z = 0 , double w = 0 ) : x(x), y(y), z(z), w(w) {}
208+ };
209+
210+ typedef unsigned long long cudaTextureObject_t;
211+ typedef unsigned long long cudaSurfaceObject_t;
212+
213+ enum cudaTextureReadMode {
214+ cudaReadModeNormalizedFloat,
215+ cudaReadModeElementType
216+ };
217+
218+ enum cudaSurfaceBoundaryMode {
219+ cudaBoundaryModeZero,
220+ cudaBoundaryModeClamp,
221+ cudaBoundaryModeTrap
222+ };
223+
224+ enum {
225+ cudaTextureType1D,
226+ cudaTextureType2D,
227+ cudaTextureType3D,
228+ cudaTextureTypeCubemap,
229+ cudaTextureType1DLayered,
230+ cudaTextureType2DLayered,
231+ cudaTextureTypeCubemapLayered
232+ };
233+
234+ struct textureReference { };
235+ template <class T , int texType = cudaTextureType1D,
236+ enum cudaTextureReadMode mode = cudaReadModeElementType>
237+ struct __attribute__ ((device_builtin_texture_type)) texture
238+ : public textureReference {};
239+
240+ struct surfaceReference { int desc; };
241+
242+ template <typename T, int dim = 1 >
243+ struct __attribute__ ((device_builtin_surface_type)) surface : public surfaceReference {};
0 commit comments