1 /* Minimal declarations for CUDA support. Testing purposes only. */
4 // Make this file work with nvcc, for testing compatibility.
7 #define __constant__ __attribute__((constant))
8 #define __device__ __attribute__((device))
9 #define __global__ __attribute__((global))
10 #define __host__ __attribute__((host))
11 #define __shared__ __attribute__((shared))
12 #define __managed__ __attribute__((managed))
13 #define __launch_bounds__(...) __attribute__((launch_bounds(__VA_ARGS__)))
17 __host__ __device__
dim3(unsigned x
, unsigned y
= 1, unsigned z
= 1) : x(x
), y(y
), z(z
) {}
20 // Host- and device-side placement new overloads.
21 void *operator new(__SIZE_TYPE__
, void *p
) { return p
; }
22 void *operator new[](__SIZE_TYPE__
, void *p
) { return p
; }
23 __device__
void *operator new(__SIZE_TYPE__
, void *p
) { return p
; }
24 __device__
void *operator new[](__SIZE_TYPE__
, void *p
) { return p
; }
26 #define CUDA_VERSION 10100
30 __host__ __device__
char2(char x
= 0, char y
= 0) : x(x
), y(y
) {}
34 __host__ __device__
char4(char x
= 0, char y
= 0, char z
= 0, char w
= 0) : x(x
), y(y
), z(z
), w(w
) {}
39 __host__ __device__
uchar2(unsigned char x
= 0, unsigned char y
= 0) : x(x
), y(y
) {}
42 unsigned char x
, y
, z
, w
;
43 __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
) {}
48 __host__ __device__
short2(short x
= 0, short y
= 0) : x(x
), y(y
) {}
52 __host__ __device__
short4(short x
= 0, short y
= 0, short z
= 0, short w
= 0) : x(x
), y(y
), z(z
), w(w
) {}
57 __host__ __device__
ushort2(unsigned short x
= 0, unsigned short y
= 0) : x(x
), y(y
) {}
60 unsigned short x
, y
, z
, w
;
61 __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
) {}
66 __host__ __device__
int2(int x
= 0, int y
= 0) : x(x
), y(y
) {}
70 __host__ __device__
int4(int x
= 0, int y
= 0, int z
= 0, int w
= 0) : x(x
), y(y
), z(z
), w(w
) {}
75 __host__ __device__
uint2(unsigned x
= 0, unsigned y
= 0) : x(x
), y(y
) {}
79 __host__ __device__
uint3(unsigned x
= 0, unsigned y
= 0, unsigned z
= 0) : x(x
), y(y
), z(z
) {}
83 __host__ __device__
uint4(unsigned x
= 0, unsigned y
= 0, unsigned z
= 0, unsigned w
= 0) : x(x
), y(y
), z(z
), w(w
) {}
88 __host__ __device__
longlong2(long long x
= 0, long long y
= 0) : x(x
), y(y
) {}
92 __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
) {}
96 unsigned long long x
, y
;
97 __host__ __device__
ulonglong2(unsigned long long x
= 0, unsigned long long y
= 0) : x(x
), y(y
) {}
100 unsigned long long x
, y
, z
, w
;
101 __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
) {}
106 __host__ __device__
float2(float x
= 0, float y
= 0) : x(x
), y(y
) {}
110 __host__ __device__
float4(float x
= 0, float y
= 0, float z
= 0, float w
= 0) : x(x
), y(y
), z(z
), w(w
) {}
115 __host__ __device__
double2(double x
= 0, double y
= 0) : x(x
), y(y
) {}
119 __host__ __device__
double4(double x
= 0, double y
= 0, double z
= 0, double w
= 0) : x(x
), y(y
), z(z
), w(w
) {}
122 typedef unsigned long long cudaTextureObject_t
;
124 enum cudaTextureReadMode
{
125 cudaReadModeNormalizedFloat
,
126 cudaReadModeElementType
133 cudaTextureTypeCubemap
,
134 cudaTextureType1DLayered
,
135 cudaTextureType2DLayered
,
136 cudaTextureTypeCubemapLayered
139 struct textureReference
{};
140 template <class T
, int texType
= cudaTextureType1D
,
141 enum cudaTextureReadMode mode
= cudaReadModeElementType
>
142 struct __attribute__((device_builtin_texture_type
)) texture
143 : public textureReference
{};