summaryrefslogtreecommitdiffstats
path: root/test/com/jogamp/opencl/CLProgramTest.java
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2011-09-21 21:29:12 +0200
committerMichael Bien <[email protected]>2011-09-21 21:29:12 +0200
commitb87b657642b6bda35bed85e8b43b3b68ac994c25 (patch)
tree86b7ffb45db16b2849184abad76bb9d1c90294b5 /test/com/jogamp/opencl/CLProgramTest.java
parentbaf07b12a2a62003334d17113e8dad1e92b80029 (diff)
initial version of parallel scan primitive. The implementation is work in progress, final version will use a different kernel/algorithm.
random float utility method for TestUtils
Diffstat (limited to 'test/com/jogamp/opencl/CLProgramTest.java')
-rw-r--r--test/com/jogamp/opencl/CLProgramTest.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/com/jogamp/opencl/CLProgramTest.java b/test/com/jogamp/opencl/CLProgramTest.java
index cf7f45ff..ae5a0926 100644
--- a/test/com/jogamp/opencl/CLProgramTest.java
+++ b/test/com/jogamp/opencl/CLProgramTest.java
@@ -55,6 +55,7 @@ import static java.lang.System.*;
import static com.jogamp.opencl.CLProgram.CompilerOptions.*;
import static com.jogamp.opencl.util.CLPlatformFilters.*;
import static com.jogamp.opencl.CLVersion.*;
+import static com.jogamp.opencl.TestUtils.*;
/**
*
@@ -364,11 +365,11 @@ public class CLProgramTest {
Random rnd = new Random(seed);
kernel.putArg(buffer);
- kernel.putArg(rnd.nextFloat());
- kernel.putArg(rnd.nextFloat(), rnd.nextFloat());
-// kernel.putArg(rnd.nextFloat(), rnd.nextFloat(), rnd.nextFloat()); // nv does not support float3
- kernel.putArg(rnd.nextFloat(), rnd.nextFloat(), rnd.nextFloat(), rnd.nextFloat());
- kernel.putArg(TestUtils.fillBuffer(Buffers.newDirectFloatBuffer(8), seed));
+ kernel.putArg(rndFloat(rnd));
+ kernel.putArg(rndFloat(rnd), rndFloat(rnd));
+// kernel.putArg(rndFloat(rnd), rndFloat(rnd), rndFloat(rnd)); // nv does not support float3
+ kernel.putArg(rndFloat(rnd), rndFloat(rnd), rndFloat(rnd), rndFloat(rnd));
+ kernel.putArg(fillBuffer(Buffers.newDirectFloatBuffer(8), seed));
CLCommandQueue queue = context.getMaxFlopsDevice().createCommandQueue();
queue.putTask(kernel).putReadBuffer(buffer, true);
@@ -377,12 +378,12 @@ public class CLProgramTest {
rnd = new Random(seed);
for(int i = 0; i < 7; i++) {
- assertEquals(rnd.nextFloat(), out.get(), 0.01f);
+ assertEquals(rndFloat(rnd), out.get(), 0.01f);
}
rnd = new Random(seed);
for(int i = 0; i < 8; i++) {
- assertEquals(rnd.nextFloat(), out.get(), 0.01f);
+ assertEquals(rndFloat(rnd), out.get(), 0.01f);
}
}finally{