summaryrefslogtreecommitdiffstats
path: root/test/com
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-01-22 18:02:35 +0100
committerMichael Bien <[email protected]>2010-01-22 18:02:35 +0100
commit9ca000faa6aea6771ff5cf209846ef7fb9ff227a (patch)
tree9c4494df5b3fd688a993c4e1672934950cb8919d /test/com
parent468928edc68896718f0a27b47d59ddad2c892967 (diff)
dynamic dispatch via CLProcAddressTable for OpenCL extensions.
made CLProgram failsafe, updated tests.
Diffstat (limited to 'test/com')
-rw-r--r--test/com/mbien/opencl/CLProgramTest.java48
1 files changed, 45 insertions, 3 deletions
diff --git a/test/com/mbien/opencl/CLProgramTest.java b/test/com/mbien/opencl/CLProgramTest.java
index 0ca0fa9e..bc095a9a 100644
--- a/test/com/mbien/opencl/CLProgramTest.java
+++ b/test/com/mbien/opencl/CLProgramTest.java
@@ -6,7 +6,6 @@ import org.junit.Test;
import static org.junit.Assert.*;
import static java.lang.System.*;
-import static com.mbien.opencl.TestUtils.*;
import static com.sun.gluegen.runtime.BufferFactory.*;
/**
@@ -31,10 +30,12 @@ public class CLProgramTest {
assertEquals(ex.errorcode, CL.CL_INVALID_PROGRAM_EXECUTABLE);
}
+ out.println(program.getBuildStatus());
program.build();
- assertTrue(program.isExecutable());
out.println(program.getBuildStatus());
+ assertTrue(program.isExecutable());
+
Map<String, CLKernel> kernels = program.getCLKernels();
assertNotNull(kernels);
assertTrue("kernel map is empty", kernels.size() > 0);
@@ -76,11 +77,52 @@ public class CLProgramTest {
// 2. re-create program with old binaries
program.release();
+ assertFalse(program.isExecutable());
+
+ assertNotNull(program.getBinaries());
+ assertEquals(program.getBinaries().size(), 0);
+
+ assertNotNull(program.getBuildLog());
+ assertEquals(program.getBuildLog().length(), 0);
+
+ assertNotNull(program.getSource());
+ assertEquals(program.getSource().length(), 0);
+
+ assertNotNull(program.getCLDevices());
+ assertEquals(program.getCLDevices().length, 0);
+
+ assertNotNull(program.getCLKernels());
+ assertEquals(program.getCLKernels().size(), 0);
+
+ assertNull(program.getCLKernel("foo"));
+
program = context.createProgram(binaries);
- out.println(program.getBuildStatus());
+ assertFalse(program.isExecutable());
+ assertNotNull(program.getCLDevices());
+ assertTrue(program.getCLDevices().length != 0);
+
+ assertNotNull(program.getBinaries());
+ assertEquals(program.getBinaries().size(), 0);
+
+ assertNotNull(program.getBuildLog());
+ assertTrue(program.getBuildLog().length() != 0);
+
+ assertNotNull(program.getSource());
+ assertEquals(program.getSource().length(), 0);
+
+ try{
+ program.getCLKernels();
+ }catch(CLException ex) {
+ // expected, not build yet
+ }
+
+ out.println(program.getBuildStatus());
program.build();
+ out.println(program.getBuildStatus());
+
+ assertNotNull(program.getCLKernel("Test"));
assertTrue(program.isExecutable());