summaryrefslogtreecommitdiffstats
path: root/test/com/mbien
diff options
context:
space:
mode:
Diffstat (limited to 'test/com/mbien')
-rw-r--r--test/com/mbien/opencl/HighLevelBindingTest.java2
-rw-r--r--test/com/mbien/opencl/LowLevelBindingTest.java40
-rw-r--r--test/com/mbien/opencl/testkernels.cl4
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