aboutsummaryrefslogtreecommitdiffstats
path: root/test/com
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2011-05-15 22:42:47 +0200
committerMichael Bien <[email protected]>2011-05-15 22:42:47 +0200
commitf12e3a9d7ac644abc98a51dc51786cf7c5b67851 (patch)
tree0a9933d8b36aaa5420d99f66c65f7d6d6b037cef /test/com
parent9159e65a631af39942579cf2258fc20aab4814e5 (diff)
CLKernel code review.
- optimized create from name path - putArg should not increment the index if setting the argument fails - added putArg() test
Diffstat (limited to 'test/com')
-rw-r--r--test/com/jogamp/opencl/CLProgramTest.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/test/com/jogamp/opencl/CLProgramTest.java b/test/com/jogamp/opencl/CLProgramTest.java
index 49c2518..a3ee26f 100644
--- a/test/com/jogamp/opencl/CLProgramTest.java
+++ b/test/com/jogamp/opencl/CLProgramTest.java
@@ -268,7 +268,7 @@ public class CLProgramTest {
@Test
public void kernelTest() {
- String source = "__attribute__((reqd_work_group_size(1, 1, 1))) kernel void foo(void) { }\n";
+ String source = "__attribute__((reqd_work_group_size(1, 1, 1))) kernel void foo(float a, int b) { }\n";
CLContext context = CLContext.create();
@@ -287,6 +287,23 @@ public class CLProgramTest {
assertEquals(1, wgs[1]);
assertEquals(1, wgs[2]);
+ // put args test
+ assertEquals(0, kernel.position());
+
+ kernel.putArg(1.0f);
+ assertEquals(1, kernel.position());
+
+ kernel.putArg(2);
+ assertEquals(2, kernel.position());
+
+ try{
+ kernel.putArg(3);
+ fail("exception not thrown");
+ }catch (IndexOutOfBoundsException expected){ }
+
+ assertEquals(2, kernel.position());
+ assertEquals(0, kernel.rewind().position());
+
}finally{
context.release();
}