summaryrefslogtreecommitdiffstats
path: root/test/com
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-02-24 17:59:23 +0100
committerMichael Bien <[email protected]>2010-02-24 17:59:23 +0100
commit2694d25e5ce59c4f4741b60242331d56601f90d1 (patch)
treea87802dcea13c761e8400e53353f822bb6139c77 /test/com
parentdc4fc464ea969614e08c81dbaeefdaaff1673296 (diff)
initial import of CLProgramBuilder.
Diffstat (limited to 'test/com')
-rw-r--r--test/com/mbien/opencl/CLProgramTest.java40
1 files changed, 39 insertions, 1 deletions
diff --git a/test/com/mbien/opencl/CLProgramTest.java b/test/com/mbien/opencl/CLProgramTest.java
index 84e0eed5..95ed5e8c 100644
--- a/test/com/mbien/opencl/CLProgramTest.java
+++ b/test/com/mbien/opencl/CLProgramTest.java
@@ -8,7 +8,6 @@ import org.junit.Test;
import static org.junit.Assert.*;
import static java.lang.System.*;
import static com.mbien.opencl.CLProgram.CompilerOptions.*;
-import static com.mbien.opencl.CLProgram.Status.*;
/**
*
@@ -143,6 +142,45 @@ public class CLProgramTest {
}
+ @Test
+ public void builderTest() throws IOException {
+ out.println(" - - - CLProgramTest; builder test - - - ");
+
+ CLContext context = CLContext.create();
+ CLProgram program = context.createProgram(getClass().getResourceAsStream("testkernels.cl"));
+
+ // same as program.build()
+ program.prepare().build();
+
+ assertTrue(program.isExecutable());
+// program.release();
+
+
+ // complex build
+ program.prepare().withOption(ENABLE_MAD)
+ .forDevice(context.getMaxFlopsDevice())
+ .withDefine("RADIUS", 5)
+ .withDefine("ENABLE_FOOBAR")
+ .build();
+
+ assertTrue(program.isExecutable());
+// program.release();
+
+ // reusable builder
+ CLProgramBuilder builder = new CLProgramBuilder()
+ .withOption(ENABLE_MAD)
+ .forDevice(context.getMaxFlopsDevice())
+ .withDefine("RADIUS", 5)
+ .withDefine("ENABLE_FOOBAR");
+
+ builder.build(program);
+
+ assertTrue(program.isExecutable());
+// program.release();
+
+
+ }
+
}