diff options
author | Sven Gothel <[email protected]> | 2011-05-18 03:51:10 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-05-18 03:51:10 +0200 |
commit | 773060662ef81707f70c447b71e664635ac45e2a (patch) | |
tree | f52c9e24b80902b08422005192df5b525f85489b /src/com/jogamp/opencl/CLProgram.java | |
parent | eceed6e10c7d6cb19e8ad3c1bf5ea20450d6fae1 (diff) | |
parent | f12e3a9d7ac644abc98a51dc51786cf7c5b67851 (diff) |
resolve conflicts
Diffstat (limited to 'src/com/jogamp/opencl/CLProgram.java')
-rw-r--r-- | src/com/jogamp/opencl/CLProgram.java | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/com/jogamp/opencl/CLProgram.java b/src/com/jogamp/opencl/CLProgram.java index 56804533..54d8cc12 100644 --- a/src/com/jogamp/opencl/CLProgram.java +++ b/src/com/jogamp/opencl/CLProgram.java @@ -32,6 +32,7 @@ import com.jogamp.common.nio.CachedBufferFactory; import com.jogamp.opencl.util.CLProgramConfiguration; import com.jogamp.opencl.util.CLUtil; import com.jogamp.common.os.Platform; +import com.jogamp.common.nio.NativeSizeBuffer; import com.jogamp.common.nio.PointerBuffer; import com.jogamp.opencl.impl.BuildProgramCallback; import com.jogamp.opencl.util.CLBuildListener; @@ -77,7 +78,7 @@ public class CLProgram extends CLObject implements CLResource { IntBuffer status = newDirectIntBuffer(1); - PointerBuffer length = PointerBuffer.allocateDirect(1).put(0, src.length()); + NativeSizeBuffer length = NativeSizeBuffer.allocateDirect(1).put(0, src.length()); String[] srcArray = new String[] {src}; // Create the program @@ -105,9 +106,9 @@ public class CLProgram extends CLObject implements CLResource { int deviceCount = binaries.size(); CachedBufferFactory bf = CachedBufferFactory.create(binarySize + pbSize*deviceCount*3 + 4, true); - PointerBuffer devices = PointerBuffer.wrap(bf.newDirectByteBuffer(deviceCount*pbSize)); + NativeSizeBuffer devices = NativeSizeBuffer.wrap(bf.newDirectByteBuffer(deviceCount*pbSize)); PointerBuffer codeBuffers = PointerBuffer.wrap(bf.newDirectByteBuffer(deviceCount*pbSize)); - PointerBuffer lengths = PointerBuffer.wrap(bf.newDirectByteBuffer(deviceCount*pbSize)); + NativeSizeBuffer lengths = NativeSizeBuffer.wrap(bf.newDirectByteBuffer(deviceCount*pbSize)); int i = 0; for (Map.Entry<CLDevice, byte[]> entry : entries) { @@ -164,7 +165,7 @@ public class CLProgram extends CLObject implements CLResource { return ""; } - PointerBuffer size = PointerBuffer.allocateDirect(1); + NativeSizeBuffer size = NativeSizeBuffer.allocateDirect(1); int ret = cl.clGetProgramBuildInfo(ID, device.ID, flag, 0, null, size); if(ret != CL_SUCCESS) { @@ -187,7 +188,7 @@ public class CLProgram extends CLObject implements CLResource { return ""; } - PointerBuffer size = PointerBuffer.allocateDirect(1); + NativeSizeBuffer size = NativeSizeBuffer.allocateDirect(1); int ret = cl.clGetProgramInfo(ID, flag, 0, null, size); checkForError(ret, "on clGetProgramInfo"); @@ -328,10 +329,10 @@ public class CLProgram extends CLObject implements CLResource { releaseKernels(); } - PointerBuffer deviceIDs = null; + NativeSizeBuffer deviceIDs = null; int count = 0; if(devices != null && devices.length != 0) { - deviceIDs = PointerBuffer.allocateDirect(devices.length); + deviceIDs = NativeSizeBuffer.allocateDirect(devices.length); for (int i = 0; i < devices.length; i++) { deviceIDs.put(i, devices[i].ID); } @@ -406,7 +407,7 @@ public class CLProgram extends CLObject implements CLResource { throw newException(err[0], "unable to create Kernel with name: "+kernelName); } - CLKernel kernel = new CLKernel(this, id); + CLKernel kernel = new CLKernel(this, kernelName, id); kernels.add(kernel); return kernel; } @@ -430,7 +431,7 @@ public class CLProgram extends CLObject implements CLResource { if(numKernels.get(0) > 0) { - PointerBuffer kernelIDs = PointerBuffer.allocateDirect(numKernels.get(0)); + NativeSizeBuffer kernelIDs = NativeSizeBuffer.allocateDirect(numKernels.get(0)); ret = cl.clCreateKernelsInProgram(ID, kernelIDs.capacity(), kernelIDs, null); if(ret != CL_SUCCESS) { throw newException(ret, "can not create "+kernelIDs.capacity()+" kernels for "+this); @@ -494,7 +495,7 @@ public class CLProgram extends CLObject implements CLResource { if(released) { return new CLDevice[0]; } - PointerBuffer size = PointerBuffer.allocateDirect(1); + NativeSizeBuffer size = NativeSizeBuffer.allocateDirect(1); int ret = cl.clGetProgramInfo(ID, CL_PROGRAM_DEVICES, 0, null, size); if(ret != CL_SUCCESS) { throw newException(ret, "on clGetProgramInfo of "+this); @@ -619,12 +620,13 @@ public class CLProgram extends CLObject implements CLResource { long address = InternalBufferUtil.getDirectBufferAddress(binaries); - PointerBuffer addresses = PointerBuffer.allocateDirect(sizes.capacity()); + NativeSizeBuffer addresses = NativeSizeBuffer.allocateDirect(sizes.capacity()); sizes.rewind(); while(sizes.remaining() != 0) { addresses.put(address); address += sizes.get(); } + addresses.rewind(); ret = cl.clGetProgramInfo(ID, CL_PROGRAM_BINARIES, addresses.capacity()*addresses.elementSize(), addresses.getBuffer(), null); if(ret != CL_SUCCESS) { |