blob: 2b8c097ddbeef79986f3a23602d8728eac80d6b7 (
plain)
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
|
kernel void VectorAddGM(global const int* a, global const int* b, global int* c, int iNumElements) {
int iGID = get_global_id(0);
if (iGID >= iNumElements) {
return;
}
c[iGID] = a[iGID] + b[iGID];
}
kernel void Test(global const int* a, global const int* b, global int* c, int iNumElements) {
int iGID = get_global_id(0);
if (iGID >= iNumElements) {
return;
}
c[iGID] = iGID;
}
kernel void add(global int* a, int value, int iNumElements) {
int iGID = get_global_id(0);
if (iGID >= iNumElements) {
return;
}
a[iGID] += value;
}
kernel void mul(global int* a, int value, int iNumElements) {
int iGID = get_global_id(0);
if (iGID >= iNumElements) {
return;
}
a[iGID] *= value;
}
|