diff options
Diffstat (limited to 'test/com/mbien/opencl')
-rw-r--r-- | test/com/mbien/opencl/CLConcurrencyTest.java | 7 | ||||
-rw-r--r-- | test/com/mbien/opencl/CLProgramTest.java | 20 | ||||
-rw-r--r-- | test/com/mbien/opencl/HighLevelBindingTest.java | 2 |
3 files changed, 15 insertions, 14 deletions
diff --git a/test/com/mbien/opencl/CLConcurrencyTest.java b/test/com/mbien/opencl/CLConcurrencyTest.java index 9234a4c8..94e8c4ee 100644 --- a/test/com/mbien/opencl/CLConcurrencyTest.java +++ b/test/com/mbien/opencl/CLConcurrencyTest.java @@ -36,7 +36,7 @@ public class CLConcurrencyTest { CLProgram program = context.createProgram(getClass().getResourceAsStream("testkernels.cl")).build(); - CLKernel vectorAddKernel = program.getCLKernel("VectorAddGM") + CLKernel vectorAddKernel = program.createCLKernel("VectorAddGM") .setArg(3, elements); CLCommandQueue queue = context.getCLDevices()[0].createCommandQueue(); @@ -106,11 +106,10 @@ public class CLConcurrencyTest { CLProgram program = context.createProgram(getClass().getResourceAsStream("testkernels.cl")).build(); - final CLKernel vectorAddKernel1 = program.getCLKernel("VectorAddGM") + final CLKernel vectorAddKernel1 = program.createCLKernel("VectorAddGM") .setArg(3, elements); - //TODO introduce public api for cloning/creating kernels - final CLKernel vectorAddKernel2 = vectorAddKernel1.copy() + final CLKernel vectorAddKernel2 = program.createCLKernel("VectorAddGM") .setArg(3, elements); diff --git a/test/com/mbien/opencl/CLProgramTest.java b/test/com/mbien/opencl/CLProgramTest.java index 52aebec4..01fc1504 100644 --- a/test/com/mbien/opencl/CLProgramTest.java +++ b/test/com/mbien/opencl/CLProgramTest.java @@ -23,7 +23,7 @@ public class CLProgramTest { CLProgram program = context.createProgram(getClass().getResourceAsStream("testkernels.cl")); try{ - program.getCLKernels(); + program.createCLKernels(); fail("expected exception but got none :("); }catch(CLException ex) { out.println("got expected exception: "+ex.getCLErrorString()); @@ -36,7 +36,7 @@ public class CLProgramTest { assertTrue(program.isExecutable()); - Map<String, CLKernel> kernels = program.getCLKernels(); + Map<String, CLKernel> kernels = program.createCLKernels(); assertNotNull(kernels); assertTrue("kernel map is empty", kernels.size() > 0); @@ -48,7 +48,7 @@ public class CLProgramTest { out.println(program.getBuildStatus()); // try again with rebuilt program - kernels = program.getCLKernels(); + kernels = program.createCLKernels(); assertNotNull(kernels); assertTrue("kernel map is empty", kernels.size() > 0); assertTrue(kernels.size() > 0); @@ -92,10 +92,12 @@ public class CLProgramTest { assertNotNull(program.getCLDevices()); assertEquals(program.getCLDevices().length, 0); - assertNotNull(program.getCLKernels()); - assertEquals(program.getCLKernels().size(), 0); - - assertNull(program.getCLKernel("foo")); + { + Map<String, CLKernel> kernels = program.createCLKernels(); + assertNotNull(kernels); + assertEquals(kernels.size(), 0); + } + assertNull(program.createCLKernel("foo")); program = context.createProgram(binaries); @@ -114,7 +116,7 @@ public class CLProgramTest { assertEquals(program.getSource().length(), 0); try{ - program.getCLKernels(); + program.createCLKernels(); }catch(CLException ex) { // expected, not build yet } @@ -123,7 +125,7 @@ public class CLProgramTest { program.build(); out.println(program.getBuildStatus()); - assertNotNull(program.getCLKernel("Test")); + assertNotNull(program.createCLKernel("Test")); assertTrue(program.isExecutable()); diff --git a/test/com/mbien/opencl/HighLevelBindingTest.java b/test/com/mbien/opencl/HighLevelBindingTest.java index 2197e22a..6ae9ac7e 100644 --- a/test/com/mbien/opencl/HighLevelBindingTest.java +++ b/test/com/mbien/opencl/HighLevelBindingTest.java @@ -154,7 +154,7 @@ public class HighLevelBindingTest { CLBuffer<ByteBuffer> clBufferB = context.createBuffer(srcB, Mem.READ_ONLY); CLBuffer<ByteBuffer> clBufferC = context.createBuffer(dest, Mem.WRITE_ONLY); - Map<String, CLKernel> kernels = program.getCLKernels(); + Map<String, CLKernel> kernels = program.createCLKernels(); for (CLKernel kernel : kernels.values()) { out.println("kernel: "+kernel.toString()); } |