aboutsummaryrefslogtreecommitdiffstats
path: root/test/com/jogamp/opencl/testkernels.cl
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2011-04-04 19:04:29 +0200
committerMichael Bien <[email protected]>2011-04-04 19:04:29 +0200
commit6612391c7ad8309ebd315cdf2a91a71f11793a61 (patch)
tree02374fe2a54bdde53c46de193123d0626d3807a4 /test/com/jogamp/opencl/testkernels.cl
parent38a1408b585fd3fe7b274708b531e98d73f1ac0c (diff)
fixed a bug which used a wrong eventlist offset under certain conditions and added a regression test.
Diffstat (limited to 'test/com/jogamp/opencl/testkernels.cl')
-rw-r--r--test/com/jogamp/opencl/testkernels.cl23
1 files changed, 17 insertions, 6 deletions
diff --git a/test/com/jogamp/opencl/testkernels.cl b/test/com/jogamp/opencl/testkernels.cl
index ec7e8bf6..2b8c097d 100644
--- a/test/com/jogamp/opencl/testkernels.cl
+++ b/test/com/jogamp/opencl/testkernels.cl
@@ -1,22 +1,33 @@
- // OpenCL Kernel Function for element by element vector addition
kernel void VectorAddGM(global const int* a, global const int* b, global int* c, int iNumElements) {
- // get index into global data array
int iGID = get_global_id(0);
- // bound check (equivalent to the limit on a 'for' loop for standard/serial C code
if (iGID >= iNumElements) {
return;
}
- // add the vector elements
c[iGID] = a[iGID] + b[iGID];
}
kernel void Test(global const int* a, global const int* b, global int* c, int iNumElements) {
- // get index into global data array
int iGID = get_global_id(0);
- // bound check (equivalent to the limit on a 'for' loop for standard/serial C code
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;
+ }