summaryrefslogtreecommitdiffstats
path: root/test/com/mbien
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-02-12 02:15:06 +0100
committerMichael Bien <[email protected]>2010-02-12 02:15:06 +0100
commita93e4532f9515f5b2c0d2c67a45db1236a29ab12 (patch)
tree71623ffb0c352481d0eaa816d3a842245a403121 /test/com/mbien
parent3d033bfadaf569d2198de6ca5dfac855dc25ac35 (diff)
fixed bug in CL[GL]Context.create(..., device), added test.
CLKernel is now Cloneable.
Diffstat (limited to 'test/com/mbien')
-rw-r--r--test/com/mbien/opencl/HighLevelBindingTest.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/com/mbien/opencl/HighLevelBindingTest.java b/test/com/mbien/opencl/HighLevelBindingTest.java
index 9c0e2343..ec3586d7 100644
--- a/test/com/mbien/opencl/HighLevelBindingTest.java
+++ b/test/com/mbien/opencl/HighLevelBindingTest.java
@@ -107,6 +107,47 @@ public class HighLevelBindingTest {
}
@Test
+ public void createContextTest() {
+
+ out.println(" - - - highLevelTest; create context - - - ");
+
+ CLPlatform platform = CLPlatform.getDefault();
+ int deviceCount = platform.listCLDevices().length;
+ CLDevice firstDevice = platform.listCLDevices()[0];
+
+ CLContext c = CLContext.create();
+ assertNotNull(c);
+ assertEquals(deviceCount, c.getCLDevices().length);
+ c.release();
+
+ c = CLContext.create(platform);
+ assertNotNull(c);
+ assertEquals(deviceCount, c.getCLDevices().length);
+ c.release();
+
+ c = CLContext.create(firstDevice);
+ assertNotNull(c);
+ assertEquals(1, c.getCLDevices().length);
+ c.release();
+
+ c = CLContext.create(CLDevice.Type.ALL);
+ assertNotNull(c);
+ assertEquals(deviceCount, c.getCLDevices().length);
+ c.release();
+
+ c = CLContext.create(platform, firstDevice);
+ assertNotNull(c);
+ assertEquals(1, c.getCLDevices().length);
+ c.release();
+
+ c = CLContext.create(platform, CLDevice.Type.ALL);
+ assertNotNull(c);
+ assertEquals(deviceCount, c.getCLDevices().length);
+ c.release();
+
+ }
+
+ @Test
public void vectorAddGMTest() throws IOException {
out.println(" - - - highLevelTest; global memory kernel - - - ");