summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-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();
+
+
+ }
+
}