diff options
author | Wade Walker <[email protected]> | 2015-10-03 14:14:25 -0500 |
---|---|---|
committer | Wade Walker <[email protected]> | 2015-11-08 14:05:30 -0600 |
commit | 4f45fe8db1b5c3790ef2659995c2065807c3fe74 (patch) | |
tree | 8a0855248986e287aeaeb4e4402c4b2139b0a0bd /src/com/jogamp/opencl/CLProgram.java | |
parent | 7c7146428a0584ad38f036d24a70c15f700f9a8e (diff) |
Remove use of CL*Binding interfaces
In preparation for removing the interfaces themselves
Diffstat (limited to 'src/com/jogamp/opencl/CLProgram.java')
-rw-r--r-- | src/com/jogamp/opencl/CLProgram.java | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/com/jogamp/opencl/CLProgram.java b/src/com/jogamp/opencl/CLProgram.java index 7e1ef6cf..6fcbc7e3 100644 --- a/src/com/jogamp/opencl/CLProgram.java +++ b/src/com/jogamp/opencl/CLProgram.java @@ -29,12 +29,11 @@ package com.jogamp.opencl; import com.jogamp.common.nio.CachedBufferFactory; -import com.jogamp.opencl.llb.CLProgramBinding; import com.jogamp.opencl.util.CLProgramConfiguration; import com.jogamp.opencl.util.CLUtil; import com.jogamp.common.os.Platform; import com.jogamp.common.nio.PointerBuffer; -import com.jogamp.opencl.llb.CLKernelBinding; +import com.jogamp.opencl.llb.CL; import com.jogamp.opencl.llb.impl.BuildProgramCallback; import com.jogamp.opencl.util.CLBuildListener; import java.nio.ByteBuffer; @@ -63,7 +62,7 @@ import static com.jogamp.common.nio.Buffers.*; public class CLProgram extends CLObjectResource { private final static ReentrantLock buildLock = new ReentrantLock(); - private final CLProgramBinding binding; + private final CL binding; private final Set<CLKernel> kernels; private Map<CLDevice, Status> buildStatusMap; @@ -76,7 +75,7 @@ public class CLProgram extends CLObjectResource { private CLProgram(final CLContext context, final long id) { super(context, id); this.kernels = new HashSet<CLKernel>(); - this.binding = context.getPlatform().getProgramBinding(); + this.binding = context.getPlatform().getCLBinding(); } static CLProgram create(final CLContext context, final String src) { @@ -87,7 +86,7 @@ public class CLProgram extends CLObjectResource { final String[] srcArray = new String[] {src}; // Create the program - final CLProgramBinding binding = context.getPlatform().getProgramBinding(); + final CL binding = context.getPlatform().getCLBinding(); final long id = binding.clCreateProgramWithSource(context.ID, 1, srcArray, length, status); final int err = status.get(); @@ -133,7 +132,7 @@ public class CLProgram extends CLObjectResource { final IntBuffer errBuffer = bf.newDirectIntBuffer(1); // IntBuffer status = newDirectByteBuffer(binaries.size()*4).asIntBuffer(); - final CLProgramBinding binding = context.getPlatform().getProgramBinding(); + final CL binding = context.getPlatform().getCLBinding(); final long id = binding.clCreateProgramWithBinary(context.ID, devices.capacity(), devices, lengths, codeBuffers, /*status*/null, errBuffer); // while(status.remaining() != 0) { @@ -218,10 +217,6 @@ public class CLProgram extends CLObjectResource { return buffer.getInt(); } - private CLKernelBinding getKernelBinding() { - return getPlatform().getKernelBinding(); - } - /** * Builds this program for all devices associated with the context. * @return this @@ -412,7 +407,7 @@ public class CLProgram extends CLObjectResource { } final int[] err = new int[1]; - final long id = getKernelBinding().clCreateKernel(ID, kernelName, err, 0); + final long id = binding.clCreateKernel(ID, kernelName, err, 0); if(err[0] != CL_SUCCESS) { throw newException(err[0], "unable to create Kernel with name: "+kernelName); } @@ -434,8 +429,7 @@ public class CLProgram extends CLObjectResource { final HashMap<String, CLKernel> newKernels = new HashMap<String, CLKernel>(); final IntBuffer numKernels = newDirectByteBuffer(4).asIntBuffer(); - final CLKernelBinding kernelBinding = getKernelBinding(); - int ret = kernelBinding.clCreateKernelsInProgram(ID, 0, null, numKernels); + int ret = binding.clCreateKernelsInProgram(ID, 0, null, numKernels); if(ret != CL_SUCCESS) { throw newException(ret, "can not create kernels for "+this); } @@ -443,7 +437,7 @@ public class CLProgram extends CLObjectResource { if(numKernels.get(0) > 0) { final PointerBuffer kernelIDs = PointerBuffer.allocateDirect(numKernels.get(0)); - ret = kernelBinding.clCreateKernelsInProgram(ID, kernelIDs.capacity(), kernelIDs, null); + ret = binding.clCreateKernelsInProgram(ID, kernelIDs.capacity(), kernelIDs, null); if(ret != CL_SUCCESS) { throw newException(ret, "can not create "+kernelIDs.capacity()+" kernels for "+this); } |