diff options
author | Michael Bien <[email protected]> | 2011-09-21 06:25:20 +0200 |
---|---|---|
committer | Michael Bien <[email protected]> | 2011-09-21 06:25:20 +0200 |
commit | baf07b12a2a62003334d17113e8dad1e92b80029 (patch) | |
tree | 7f1d345ed624bd38d909402051383cc1f43148b9 /test | |
parent | ccfc0b128c0eeee54ded44fc3700de54e9532213 (diff) |
bugfixes for parallel reduction primitive
- wrong cache size
- illegal read from cache on overflow -> read from gloabal mem
Diffstat (limited to 'test')
-rw-r--r-- | test/com/jogamp/opencl/util/pp/ReductionTest.java | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/test/com/jogamp/opencl/util/pp/ReductionTest.java b/test/com/jogamp/opencl/util/pp/ReductionTest.java index 94d1f53b..5096e439 100644 --- a/test/com/jogamp/opencl/util/pp/ReductionTest.java +++ b/test/com/jogamp/opencl/util/pp/ReductionTest.java @@ -34,7 +34,9 @@ import com.jogamp.common.nio.Buffers; import com.jogamp.opencl.CLCommandQueue; import com.jogamp.opencl.CLContext; import com.jogamp.opencl.CLDevice; +import com.jogamp.opencl.CLErrorHandler; import com.jogamp.opencl.CLPlatform; +import java.nio.ByteBuffer; import java.nio.DoubleBuffer; import java.nio.FloatBuffer; import java.nio.IntBuffer; @@ -86,7 +88,7 @@ public class ReductionTest { max.release(); assertTrue(max.isReleased()); - assertEquals(expected_max, output.get(0)); + assertEquals("max", expected_max, output.get(0)); Reduction<IntBuffer> min = Reduction.create(context, Op.MIN, IntBuffer.class); min.reduce(queue, input, output); @@ -95,7 +97,7 @@ public class ReductionTest { min.release(); assertTrue(min.isReleased()); - assertEquals(expected_min, output.get(0)); + assertEquals("min", expected_min, output.get(0)); Reduction<IntBuffer> sum = Reduction.create(context, Op.ADD, IntBuffer.class); sum.reduce(queue, input, output); @@ -104,7 +106,7 @@ public class ReductionTest { sum.release(); assertTrue(sum.isReleased()); - assertEquals(expected_sum, output.get(0)); + assertEquals("sum", expected_sum, output.get(0)); }finally{ context.release(); @@ -143,7 +145,7 @@ public class ReductionTest { max.release(); assertTrue(max.isReleased()); - assertEquals(expected_max, output.get(0), EPSILON); + assertEquals("max", expected_max, output.get(0), EPSILON); Reduction<FloatBuffer> min = Reduction.create(context, Op.MIN, FloatBuffer.class); min.reduce(queue, input, output); @@ -152,14 +154,14 @@ public class ReductionTest { min.release(); assertTrue(min.isReleased()); - assertEquals(expected_min, output.get(0), EPSILON); + assertEquals("min", expected_min, output.get(0), EPSILON); Reduction<FloatBuffer> sum = Reduction.create(context, Op.ADD, FloatBuffer.class); sum.reduce(queue, input, output); output.rewind(); sum.release(); - assertTrue(sum.isReleased()); + assertTrue("sum", sum.isReleased()); assertEquals(expected_sum, output.get(0), Math.ulp(expected_sum)*SUM_EPSILON); @@ -200,7 +202,7 @@ public class ReductionTest { max.release(); assertTrue(max.isReleased()); - assertEquals(expected_max, output.get(0), EPSILON); + assertEquals("max", expected_max, output.get(0), EPSILON); Reduction<DoubleBuffer> min = Reduction.create(context, Op.MIN, DoubleBuffer.class); min.reduce(queue, input, output); @@ -209,7 +211,7 @@ public class ReductionTest { min.release(); assertTrue(min.isReleased()); - assertEquals(expected_min, output.get(0), EPSILON); + assertEquals("min", expected_min, output.get(0), EPSILON); Reduction<DoubleBuffer> sum = Reduction.create(context, Op.ADD, DoubleBuffer.class); sum.reduce(queue, input, output); @@ -218,7 +220,7 @@ public class ReductionTest { sum.release(); assertTrue(sum.isReleased()); - assertEquals(expected_sum, output.get(0), Math.ulp(expected_sum)*SUM_EPSILON); + assertEquals("sum", expected_sum, output.get(0), Math.ulp(expected_sum)*SUM_EPSILON); }finally{ context.release(); |