diff options
author | Michael Bien <[email protected]> | 2010-04-15 21:36:21 +0200 |
---|---|---|
committer | Michael Bien <[email protected]> | 2010-04-15 21:36:21 +0200 |
commit | bb14f43134a9332c014e969b600e094edadd2fb0 (patch) | |
tree | a63678de5a0b8b5f5c21bd732b159ba151c274f9 /test/com/jogamp/opencl/CLProgramTest.java | |
parent | 966153e376f9932cea29d8bd891a164115a4049c (diff) |
code review: improved exception messages to be more verbose whenever possible.
began with CLKernel testcase.
Diffstat (limited to 'test/com/jogamp/opencl/CLProgramTest.java')
-rw-r--r-- | test/com/jogamp/opencl/CLProgramTest.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/com/jogamp/opencl/CLProgramTest.java b/test/com/jogamp/opencl/CLProgramTest.java index 8b5d4362..18ae1e85 100644 --- a/test/com/jogamp/opencl/CLProgramTest.java +++ b/test/com/jogamp/opencl/CLProgramTest.java @@ -153,6 +153,8 @@ public class CLProgramTest { assertTrue(program.isExecutable()); + context.release(); + } @Test @@ -217,8 +219,34 @@ public class CLProgramTest { // cloneing assertEquals(builder, builder.clone()); + context.release(); } + @Test + public void kernelTest() { + + String source = "__attribute__((reqd_work_group_size(512, 512, 512))) kernel void foo(void) { }\n"; + + CLContext context = CLContext.create(); + + try{ + CLProgram program = context.createProgram(source).build(); + assertTrue(program.isExecutable()); + + CLKernel kernel = program.createCLKernel("foo"); + assertNotNull(kernel); + + long[] wgs = kernel.getCompileWorkGroupSize(context.getDevices()[0]); + + // TODO test on other hardware and compare results + out.println("compile workgroup size: " + wgs[0]+" "+wgs[1]+" "+wgs[2]); + + }finally{ + context.release(); + } + + } + } |