summaryrefslogtreecommitdiffstats
path: root/test/com/jogamp
diff options
context:
space:
mode:
Diffstat (limited to 'test/com/jogamp')
-rw-r--r--test/com/jogamp/opencl/util/concurrent/CLMultiContextTest.java35
1 files changed, 33 insertions, 2 deletions
diff --git a/test/com/jogamp/opencl/util/concurrent/CLMultiContextTest.java b/test/com/jogamp/opencl/util/concurrent/CLMultiContextTest.java
index 8e96dafa..f076324a 100644
--- a/test/com/jogamp/opencl/util/concurrent/CLMultiContextTest.java
+++ b/test/com/jogamp/opencl/util/concurrent/CLMultiContextTest.java
@@ -6,6 +6,7 @@ package com.jogamp.opencl.util.concurrent;
import com.jogamp.opencl.CLContext;
import com.jogamp.opencl.CLDevice;
import com.jogamp.opencl.CLPlatform;
+import com.jogamp.opencl.util.concurrent.CLQueueContextFactory.CLSimpleContextFactory;
import org.junit.Rule;
import org.junit.rules.MethodRule;
import org.junit.rules.Timeout;
@@ -22,8 +23,8 @@ import static java.lang.System.*;
*/
public class CLMultiContextTest {
- @Rule
- public MethodRule methodTimeout= new Timeout(10000);
+// @Rule
+// public MethodRule methodTimeout= new Timeout(10000);
@Test
public void createMultiContextTest() {
@@ -50,5 +51,35 @@ public class CLMultiContextTest {
}
+ 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 in 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";
+
+ @Test
+ public void commandQueuePoolTest() {
+
+ CLMultiContext mc = CLMultiContext.create(CLPlatform.listCLPlatforms());
+
+ try {
+
+ CLSimpleContextFactory factory = CLQueueContextFactory.createSimple(programSource);
+ CLCommandQueuePool pool = CLCommandQueuePool.create(factory, mc);
+
+ assertTrue(pool.getSize() > 0);
+
+ pool.release();
+ }finally{
+ mc.release();
+ }
+ }
}