aboutsummaryrefslogtreecommitdiffstats
path: root/test/com/jogamp/opencl/CLProgramTest.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-09-01 15:45:41 +0200
committerSven Gothel <[email protected]>2014-09-01 15:45:41 +0200
commit426f3663822cb85c9014ca87affc66181acd0fe8 (patch)
treef5290c84e8b6402e7b0b7681f896dcecb39deefb /test/com/jogamp/opencl/CLProgramTest.java
parent3f26e71bf32977f05364b6ea72cbf3dacf4758ed (diff)
Bug 1057: Analyze CLProgramTest freeze on Win 8.1 Intel i7-4770T CPU / HD Graphics 4600
- Properly enforce test order (alphanumeric) - Split builderTest() to synchronized and async tests
Diffstat (limited to 'test/com/jogamp/opencl/CLProgramTest.java')
-rw-r--r--test/com/jogamp/opencl/CLProgramTest.java57
1 files changed, 30 insertions, 27 deletions
diff --git a/test/com/jogamp/opencl/CLProgramTest.java b/test/com/jogamp/opencl/CLProgramTest.java
index e5baeb2c..5946deb4 100644
--- a/test/com/jogamp/opencl/CLProgramTest.java
+++ b/test/com/jogamp/opencl/CLProgramTest.java
@@ -28,7 +28,6 @@
package com.jogamp.opencl;
-import com.jogamp.opencl.test.util.MiscUtils;
import com.jogamp.opencl.test.util.UITestCase;
import com.jogamp.opencl.util.CLBuildConfiguration;
import com.jogamp.opencl.util.CLProgramConfiguration;
@@ -67,7 +66,7 @@ public class CLProgramTest extends UITestCase {
@Test
- public void enumsTest() {
+ public void test01Enums() {
// CLProgram enums
for (final Status e : Status.values()) {
@@ -76,10 +75,7 @@ public class CLProgramTest extends UITestCase {
}
@Test
- public void rebuildProgramTest() throws IOException {
-
- out.println(" - - - CLProgramTest; rebuild program test - - - ");
-
+ public void test02RebuildProgram() throws IOException {
final CLContext context = CLContext.create();
final CLProgram program = context.createProgram(getClass().getResourceAsStream("testkernels.cl"));
@@ -119,10 +115,7 @@ public class CLProgramTest extends UITestCase {
}
@Test
- public void programBinariesTest() throws IOException {
-
- out.println(" - - - CLProgramTest; down-/upload binaries test - - - ");
-
+ public void test03ProgramBinaries() throws IOException {
final CLContext context = CLContext.create();
CLProgram program = context.createProgram(getClass().getResourceAsStream("testkernels.cl"))
.build(ENABLE_MAD, WARNINGS_ARE_ERRORS);
@@ -200,10 +193,7 @@ public class CLProgramTest extends UITestCase {
}
- @Test
- public void builderTest() throws IOException, ClassNotFoundException, InterruptedException {
- out.println(" - - - CLProgramTest; program builder test - - - ");
-
+ private void builderImpl(final boolean sync) throws IOException, ClassNotFoundException, InterruptedException {
final CLContext context = CLContext.create();
CLProgram program = context.createProgram(getClass().getResourceAsStream("testkernels.cl"));
@@ -231,8 +221,14 @@ public class CLProgramTest extends UITestCase {
out.println(builder);
- // async build test
- {
+ if( sync ) {
+ // sync build test
+ final CLProgram outerProgram = program;
+
+ builder.setProgram(program).build();
+ assertEquals(outerProgram, program);
+ } else {
+ // async build test
final CountDownLatch countdown = new CountDownLatch(1);
final CLProgram outerProgram = program;
@@ -243,7 +239,6 @@ public class CLProgramTest extends UITestCase {
countdown.countDown();
}
};
-
builder.setProgram(program).build(buildCallback);
countdown.await();
}
@@ -274,7 +269,6 @@ public class CLProgramTest extends UITestCase {
program = programConfig.build();
assertTrue(program.isExecutable());
-
// cloneing
assertEquals(builder, builder.clone());
@@ -283,13 +277,23 @@ public class CLProgramTest extends UITestCase {
@Test
- public void kernelTest() {
- final String source = "__attribute__((reqd_work_group_size(1, 1, 1))) kernel void foo(float a, int b, short c) { }\n";
+ public void test10BuilderSync() throws IOException, ClassNotFoundException, InterruptedException {
+ builderImpl(true);
+ }
+
+ @Test
+ public void test11BuilderAsync() throws IOException, ClassNotFoundException, InterruptedException {
+ builderImpl(false);
+ }
+ private static final String test20KernelSource = "__attribute__((reqd_work_group_size(1, 1, 1))) kernel void foo(float a, int b, short c) { }\n";
+
+ @Test
+ public void test20Kernel() {
final CLContext context = CLContext.create();
try{
- final CLProgram program = context.createProgram(source).build();
+ final CLProgram program = context.createProgram(test20KernelSource).build();
assertTrue(program.isExecutable());
final CLKernel kernel = program.createCLKernel("foo");
@@ -330,8 +334,7 @@ public class CLProgramTest extends UITestCase {
}
@Test
- public void createAllKernelsTest() {
-
+ public void test21AllKernels() {
final String source = "kernel void foo(int a) { }\n"+
"kernel void bar(float b) { }\n";
@@ -359,11 +362,11 @@ public class CLProgramTest extends UITestCase {
}
// @Test
- public void loadTest() throws IOException, ClassNotFoundException, InterruptedException {
+ public void test60Load() throws IOException, ClassNotFoundException, InterruptedException {
for(int i = 0; i < 100; i++) {
- rebuildProgramTest();
- builderTest();
- programBinariesTest();
+ test02RebuildProgram();
+ test11BuilderAsync();
+ test03ProgramBinaries();
}
}