diff options
author | Michael Bien <[email protected]> | 2010-01-02 00:15:55 +0100 |
---|---|---|
committer | Michael Bien <[email protected]> | 2010-01-02 00:15:55 +0100 |
commit | a5efe050242d1d6a45e03fcac1763ff90877e322 (patch) | |
tree | b8135791915083d1e36b383a182f2973927c8ead /test/com | |
parent | 72203a5d1f8896463ded10d1b21ca116621d1900 (diff) |
introduced CLGLContext, refactored dependencies, cleanup in opencl code.
Diffstat (limited to 'test/com')
-rw-r--r-- | test/com/mbien/opencl/HighLevelBindingTest.java | 2 | ||||
-rw-r--r-- | test/com/mbien/opencl/LowLevelBindingTest.java | 40 | ||||
-rw-r--r-- | test/com/mbien/opencl/testkernels.cl | 4 |
3 files changed, 23 insertions, 23 deletions
diff --git a/test/com/mbien/opencl/HighLevelBindingTest.java b/test/com/mbien/opencl/HighLevelBindingTest.java index bd6d7179..42e74667 100644 --- a/test/com/mbien/opencl/HighLevelBindingTest.java +++ b/test/com/mbien/opencl/HighLevelBindingTest.java @@ -241,7 +241,7 @@ public class HighLevelBindingTest { fail("expected exception but got none :("); }catch(CLException ex) { out.println("got expected exception:\n"+ex.getMessage()); - assertTrue(ex.errorcode == CL.CL_INVALID_PROGRAM_EXECUTABLE); + assertEquals(ex.errorcode, CL.CL_INVALID_PROGRAM_EXECUTABLE); } program.build(); diff --git a/test/com/mbien/opencl/LowLevelBindingTest.java b/test/com/mbien/opencl/LowLevelBindingTest.java index 83e0ca45..0a600102 100644 --- a/test/com/mbien/opencl/LowLevelBindingTest.java +++ b/test/com/mbien/opencl/LowLevelBindingTest.java @@ -20,26 +20,26 @@ import static com.sun.gluegen.runtime.BufferFactory.*; public class LowLevelBindingTest { private final static String programSource = - " // OpenCL Kernel Function for element by element vector addition \n" - + "__kernel void VectorAdd(__global const int* a, __global const int* b, __global int* c, int iNumElements) { \n" - + " // get index into global data array \n" - + " int iGID = get_global_id(0); \n" - + " // bound check (equivalent to the limit on a 'for' loop for standard/serial C code \n" - + " if (iGID >= iNumElements) { \n" - + " return; \n" - + " } \n" - + " // add the vector elements \n" - + " c[iGID] = a[iGID] + b[iGID]; \n" - + "} \n" - + "__kernel void Test(__global const int* a, __global const int* b, __global int* c, int iNumElements) { \n" - + " // get index into global data array \n" - + " int iGID = get_global_id(0); \n" - + " // bound check (equivalent to the limit on a 'for' loop for standard/serial C code \n" - + " if (iGID >= iNumElements) { \n" - + " return; \n" - + " } \n" - + " c[iGID] = iGID; \n" - + "} \n"; + " // OpenCL Kernel Function for element by element vector addition \n" + + "kernel void VectorAdd(global const int* a, global const int* b, global int* c, int iNumElements) { \n" + + " // get index into global data array \n" + + " int iGID = get_global_id(0); \n" + + " // bound check (equivalent to the limit on a 'for' loop for standard/serial C code \n" + + " if (iGID >= iNumElements) { \n" + + " return; \n" + + " } \n" + + " // add the vector elements \n" + + " c[iGID] = a[iGID] + b[iGID]; \n" + + "} \n" + + "kernel void Test(global const int* a, global const int* b, global int* c, int iNumElements) { \n" + + " // get index into global data array \n" + + " int iGID = get_global_id(0); \n" + + " // bound check (equivalent to the limit on a 'for' loop for standard/serial C code \n" + + " if (iGID >= iNumElements) { \n" + + " return; \n" + + " } \n" + + " c[iGID] = iGID; \n" + + "} \n"; @BeforeClass diff --git a/test/com/mbien/opencl/testkernels.cl b/test/com/mbien/opencl/testkernels.cl index 0790cb32..ec7e8bf6 100644 --- a/test/com/mbien/opencl/testkernels.cl +++ b/test/com/mbien/opencl/testkernels.cl @@ -1,6 +1,6 @@ // 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) { + 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 @@ -11,7 +11,7 @@ c[iGID] = a[iGID] + b[iGID]; } - __kernel void Test(__global const int* a, __global const int* b, __global int* c, int iNumElements) { + 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 |