ThunderSVM
ThunderSVM: An Open-Source SVM Library on GPUs and CPUs
include
thundersvm
clion_cuda.h
1
//
2
// Created by jiashuai on 17-9-14.
3
//
4
5
#ifndef THUNDERSVM_CLION_CUDA_H
6
#define THUNDERSVM_CLION_CUDA_H
7
8
#include <config.h>
9
#ifdef __JETBRAINS_IDE__
10
#ifdef USE_CUDA
11
#include "math.h"
12
#define __CUDACC__ 1
13
#define __host__
14
#define __device__
15
#define __global__
16
#define __noinline__
17
#define __forceinline__
18
#define __shared__
19
#define __constant__
20
#define __managed__
21
#define __restrict__
22
// CUDA Synchronization
23
inline
void
__syncthreads() {};
24
inline
void
__threadfence_block() {};
25
inline
void
__threadfence() {};
26
inline
void
__threadfence_system();
27
inline
int
__syncthreads_count(
int
predicate) {
return
predicate};
28
inline
int
__syncthreads_and(
int
predicate) {
return
predicate};
29
inline
int
__syncthreads_or(
int
predicate) {
return
predicate};
30
template
<
class
T>
inline
T __clz(
const
T val) {
return
val; }
31
template
<
class
T>
inline
T __ldg(
const
T* address){
return
*address};
32
// CUDA TYPES
33
typedef
unsigned
short
uchar;
34
typedef
unsigned
short
ushort;
35
typedef
unsigned
int
uint;
36
typedef
unsigned
long
ulong;
37
typedef
unsigned
long
long
ulonglong;
38
typedef
long
long
longlong;
39
40
typedef
struct
uchar1{
41
uchar x;
42
}uchar1;
43
44
typedef
struct
uchar2{
45
uchar x;
46
uchar y;
47
}uchar2;
48
49
typedef
struct
uchar3{
50
uchar x;
51
uchar y;
52
uchar z;
53
}uchar3;
54
55
typedef
struct
uchar4{
56
uchar x;
57
uchar y;
58
uchar z;
59
uchar w;
60
}uchar4;
61
62
typedef
struct
char1{
63
char
x;
64
}char1;
65
66
typedef
struct
char2{
67
char
x;
68
char
y;
69
}char2;
70
71
typedef
struct
char3{
72
char
x;
73
char
y;
74
char
z;
75
}char3;
76
77
typedef
struct
char4{
78
char
x;
79
char
y;
80
char
z;
81
char
w;
82
}char4;
83
84
typedef
struct
ushort1{
85
ushort x;
86
}ushort1;
87
88
typedef
struct
ushort2{
89
ushort x;
90
ushort y;
91
}ushort2;
92
93
typedef
struct
ushort3{
94
ushort x;
95
ushort y;
96
ushort z;
97
}ushort3;
98
99
typedef
struct
ushort4{
100
ushort x;
101
ushort y;
102
ushort z;
103
ushort w;
104
}ushort4;
105
106
typedef
struct
short1{
107
short
x;
108
}short1;
109
110
typedef
struct
short2{
111
short
x;
112
short
y;
113
}short2;
114
115
typedef
struct
short3{
116
short
x;
117
short
y;
118
short
z;
119
}short3;
120
121
typedef
struct
short4{
122
short
x;
123
short
y;
124
short
z;
125
short
w;
126
}short4;
127
128
typedef
struct
uint1{
129
uint x;
130
}uint1;
131
132
typedef
struct
uint2{
133
uint x;
134
uint y;
135
}uint2;
136
137
typedef
struct
uint3{
138
uint x;
139
uint y;
140
uint z;
141
}uint3;
142
143
typedef
struct
uint4{
144
uint x;
145
uint y;
146
uint z;
147
uint w;
148
}uint4;
149
150
typedef
struct
int1{
151
int
x;
152
}int1;
153
154
typedef
struct
int2{
155
int
x;
156
int
y;
157
}int2;
158
159
typedef
struct
int3{
160
int
x;
161
int
y;
162
int
z;
163
}int3;
164
165
typedef
struct
int4{
166
int
x;
167
int
y;
168
int
z;
169
int
w;
170
}int4;
171
172
typedef
struct
ulong1{
173
ulong x;
174
}ulong1;
175
176
typedef
struct
ulong2{
177
ulong x;
178
ulong y;
179
}ulong2;
180
181
typedef
struct
ulong3{
182
ulong x;
183
ulong y;
184
ulong z;
185
}ulong3;
186
187
typedef
struct
ulong4{
188
ulong x;
189
ulong y;
190
ulong z;
191
ulong w;
192
}ulong4;
193
194
typedef
struct
long1{
195
long
x;
196
}long1;
197
198
typedef
struct
long2{
199
long
x;
200
long
y;
201
}long2;
202
203
typedef
struct
long3{
204
long
x;
205
long
y;
206
long
z;
207
}long3;
208
209
typedef
struct
long4{
210
long
x;
211
long
y;
212
long
z;
213
long
w;
214
}long4;
215
216
typedef
struct
ulonglong1{
217
ulonglong x;
218
}ulonglong1;
219
220
typedef
struct
ulonglong2{
221
ulonglong x;
222
ulonglong y;
223
}ulonglong2;
224
225
typedef
struct
ulonglong3{
226
ulonglong x;
227
ulonglong y;
228
ulonglong z;
229
}ulonglong3;
230
231
typedef
struct
ulonglong4{
232
ulonglong x;
233
ulonglong y;
234
ulonglong z;
235
ulonglong w;
236
}ulonglong4;
237
238
typedef
struct
longlong1{
239
longlong x;
240
}longlong1;
241
242
typedef
struct
longlong2{
243
longlong x;
244
longlong y;
245
}longlong2;
246
247
typedef
struct
float1{
248
float
x;
249
}float1;
250
251
typedef
struct
float2{
252
float
x;
253
float
y;
254
}float2;
255
256
typedef
struct
float3{
257
float
x;
258
float
y;
259
float
z;
260
}float3;
261
262
typedef
struct
float4{
263
float
x;
264
float
y;
265
float
z;
266
float
w;
267
}float4;
268
269
typedef
struct
double1{
270
double
x;
271
}double1;
272
273
typedef
struct
double2{
274
double
x;
275
double
y;
276
}double2;
277
278
typedef
uint3 dim3;
279
280
extern
dim3 gridDim;
281
extern
uint3 blockIdx;
282
extern
dim3 blockDim;
283
extern
uint3 threadIdx;
284
extern
int
warpsize;
285
#endif
286
#endif
287
#endif //THUNDERSVM_CLION_CUDA_H
Generated by
1.8.13