diff options
Diffstat (limited to 'test/com/jogamp/opencl/CLProgramTest.java')
-rw-r--r-- | test/com/jogamp/opencl/CLProgramTest.java | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/test/com/jogamp/opencl/CLProgramTest.java b/test/com/jogamp/opencl/CLProgramTest.java index fd98e78e..392bf33f 100644 --- a/test/com/jogamp/opencl/CLProgramTest.java +++ b/test/com/jogamp/opencl/CLProgramTest.java @@ -61,9 +61,8 @@ public class CLProgramTest { assertTrue(program.isExecutable()); - Map<String, CLKernel> kernels = program.createCLKernels(); - assertNotNull(kernels); - assertTrue("kernel map is empty", kernels.size() > 0); + CLKernel kernel = program.createCLKernel("VectorAddGM"); + assertNotNull(kernel); // rebuild // 1. release kernels (internally) @@ -73,10 +72,8 @@ public class CLProgramTest { out.println(program.getBuildStatus()); // try again with rebuilt program - kernels = program.createCLKernels(); - assertNotNull(kernels); - assertTrue("kernel map is empty", kernels.size() > 0); - assertTrue(kernels.size() > 0); + kernel = program.createCLKernel("VectorAddGM"); + assertNotNull(kernel); context.release(); } @@ -277,6 +274,35 @@ public class CLProgramTest { } + @Test + public void createAllKernelsTest() { + + String source = "kernel void foo(int a) { }\n"+ + "kernel void bar(float b) { }\n"; + + CLContext context = CLContext.create(); + try{ + CLProgram program = context.createProgram(source).build(); + assertTrue(program.isExecutable()); + + Map<String, CLKernel> kernels = program.createCLKernels(); + for (CLKernel kernel : kernels.values()) { + out.println("kernel: "+kernel.toString()); + } + + assertNotNull(kernels.get("foo")); + assertNotNull(kernels.get("bar")); + + kernels.get("foo").setArg(0, 42); + kernels.get("bar").setArg(0, 3.14f); + + + }finally{ + context.release(); + } + + } + // @Test public void loadTest() throws IOException, ClassNotFoundException, InterruptedException { for(int i = 0; i < 100; i++) { |