From bf07b44ed6a8958dd321cc4c08fd2bdd08299611 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Mon, 12 Apr 2010 22:18:39 +0200 Subject: renamed package com.mbien.* in com.jogamp.* JOCL is now officially a JogAmp team player ;). --- test/com/jogamp/opencl/testkernels.cl | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/com/jogamp/opencl/testkernels.cl (limited to 'test/com/jogamp/opencl/testkernels.cl') diff --git a/test/com/jogamp/opencl/testkernels.cl b/test/com/jogamp/opencl/testkernels.cl new file mode 100644 index 00000000..ec7e8bf6 --- /dev/null +++ b/test/com/jogamp/opencl/testkernels.cl @@ -0,0 +1,22 @@ + + // 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; + } -- cgit v1.2.3