forked from hughperkins/EasyCL
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtesteasycl.cl
More file actions
44 lines (39 loc) · 1.15 KB
/
testeasycl.cl
File metadata and controls
44 lines (39 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
kernel void test(global float *in, global float *out) {
const int globalid = get_global_id(0);
out[globalid] = in[globalid] + 7;
}
kernel void testuchars(global unsigned char *in, global unsigned char *out) {
const int globalid = get_global_id(0);
out[globalid] = in[globalid] + 7;
}
kernel void test_int(global int *in, global int *out) {
const int globalid = get_global_id(0);
out[globalid] = in[globalid] + 7;
}
kernel void test_stress(global const int *in, global int *out) {
const int globalid = get_global_id(0);
int sum = 0;
int n = 0;
// make it do some work....
// while(n < 1000000) {
while(n < 10001) {
sum = (sum + in[n % 47]) % (103070 * 7);
n++;
}
out[globalid] = sum;
}
kernel void test_read(const int one, const int two, global int *out) {
const int globalid = get_global_id(0);
int sum = 0;
int n = 0;
while(n < 100000) {
sum = (sum + one) % 1357 * two;
n++;
}
// out[globalid+2048] = sum;
// out[globalid] = sum;
// out[0] = 44;
out[globalid] = sum;
// out[0] = globalid > out[0] ? globalid : out[0];
// out[globalid] = 8827;
}