diff options
author | Michael Bien <[email protected]> | 2010-03-29 04:09:24 +0200 |
---|---|---|
committer | Michael Bien <[email protected]> | 2010-03-29 04:09:24 +0200 |
commit | 1c0265824a1a86e758abf7f0a0b1d1e43c5ef167 (patch) | |
tree | 369232785f03fd4844ae073ef063dd5a09576173 /src | |
parent | 9dab3d93ffaa04f9cf370648c67219694c58555a (diff) |
changes due to BufferFactory -> Buffers renaming in gluegen.
Diffstat (limited to 'src')
-rw-r--r-- | src/com/mbien/opencl/CLContext.java | 6 | ||||
-rw-r--r-- | src/com/mbien/opencl/CLImage2d.java | 4 | ||||
-rw-r--r-- | src/com/mbien/opencl/CLImage3d.java | 4 | ||||
-rw-r--r-- | src/com/mbien/opencl/CLKernel.java | 4 | ||||
-rw-r--r-- | src/com/mbien/opencl/CLMemory.java | 12 | ||||
-rw-r--r-- | src/com/mbien/opencl/CLProgram.java | 12 |
6 files changed, 21 insertions, 21 deletions
diff --git a/src/com/mbien/opencl/CLContext.java b/src/com/mbien/opencl/CLContext.java index 0d9e1d90..9f7f1096 100644 --- a/src/com/mbien/opencl/CLContext.java +++ b/src/com/mbien/opencl/CLContext.java @@ -4,7 +4,7 @@ import com.mbien.opencl.CLDevice.Type; import com.mbien.opencl.CLMemory.Mem; import com.mbien.opencl.CLSampler.AddressingMode; import com.mbien.opencl.CLSampler.FilteringMode; -import com.jogamp.gluegen.runtime.BufferFactory; +import com.jogamp.gluegen.runtime.Buffers; import com.jogamp.gluegen.runtime.CPU; import com.jogamp.gluegen.runtime.PointerBuffer; import java.io.BufferedReader; @@ -26,7 +26,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import static com.mbien.opencl.CLException.*; -import static com.jogamp.gluegen.runtime.BufferFactory.*; +import static com.jogamp.gluegen.runtime.Buffers.*; /** * CLContext is responsible for managing objects such as command-queues, memory, @@ -156,7 +156,7 @@ public class CLContext extends CLObject implements CLResource { protected static long createContext(PointerBuffer properties, CLDevice... devices) { - IntBuffer status = BufferFactory.newDirectByteBuffer(4).asIntBuffer(); + IntBuffer status = Buffers.newDirectByteBuffer(4).asIntBuffer(); PointerBuffer pb = null; if(devices != null && devices.length != 0) { pb = PointerBuffer.allocateDirect(devices.length); diff --git a/src/com/mbien/opencl/CLImage2d.java b/src/com/mbien/opencl/CLImage2d.java index 337b0021..2c7a3a87 100644 --- a/src/com/mbien/opencl/CLImage2d.java +++ b/src/com/mbien/opencl/CLImage2d.java @@ -1,6 +1,6 @@ package com.mbien.opencl; -import com.jogamp.gluegen.runtime.BufferFactory; +import com.jogamp.gluegen.runtime.Buffers; import java.nio.Buffer; import java.nio.IntBuffer; @@ -24,7 +24,7 @@ public class CLImage2d<B extends Buffer> extends CLImage<B> { int width, int height, int rowPitch, CLImageFormat format, int flags) { CL cl = context.cl; - IntBuffer err = BufferFactory.newDirectByteBuffer(4).asIntBuffer(); + IntBuffer err = Buffers.newDirectByteBuffer(4).asIntBuffer(); long id = cl.clCreateImage2D(context.ID, flags, format.getFormatImpl(), width, height, rowPitch, directBuffer, err); checkForError(err.get(), "can not create 2d image"); diff --git a/src/com/mbien/opencl/CLImage3d.java b/src/com/mbien/opencl/CLImage3d.java index bef7ac57..30db943f 100644 --- a/src/com/mbien/opencl/CLImage3d.java +++ b/src/com/mbien/opencl/CLImage3d.java @@ -1,6 +1,6 @@ package com.mbien.opencl; -import com.jogamp.gluegen.runtime.BufferFactory; +import com.jogamp.gluegen.runtime.Buffers; import java.nio.Buffer; import java.nio.IntBuffer; @@ -30,7 +30,7 @@ public class CLImage3d<B extends Buffer> extends CLImage<B> { int width, int height, int depth, int rowPitch, int slicePitch, CLImageFormat format, int flags) { CL cl = context.cl; - IntBuffer err = BufferFactory.newDirectByteBuffer(4).asIntBuffer(); + IntBuffer err = Buffers.newDirectByteBuffer(4).asIntBuffer(); long id = cl.clCreateImage3D(context.ID, flags, format.getFormatImpl(), width, height, depth, rowPitch, slicePitch, directBuffer, err); checkForError(err.get(), "can not create 2d image"); diff --git a/src/com/mbien/opencl/CLKernel.java b/src/com/mbien/opencl/CLKernel.java index 0ef2d835..12d1047b 100644 --- a/src/com/mbien/opencl/CLKernel.java +++ b/src/com/mbien/opencl/CLKernel.java @@ -1,7 +1,7 @@ package com.mbien.opencl; import com.mbien.opencl.util.CLUtil; -import com.jogamp.gluegen.runtime.BufferFactory; +import com.jogamp.gluegen.runtime.Buffers; import com.jogamp.gluegen.runtime.CPU; import com.jogamp.gluegen.runtime.PointerBuffer; import java.nio.Buffer; @@ -37,7 +37,7 @@ public class CLKernel extends CLObject implements CLResource, Cloneable { CLKernel(CLProgram program, long id) { super(program.getContext(), id); this.program = program; - this.buffer = BufferFactory.newDirectByteBuffer(8); + this.buffer = Buffers.newDirectByteBuffer(8); PointerBuffer pb = PointerBuffer.allocateDirect(1); diff --git a/src/com/mbien/opencl/CLMemory.java b/src/com/mbien/opencl/CLMemory.java index ff34b344..ad423e73 100644 --- a/src/com/mbien/opencl/CLMemory.java +++ b/src/com/mbien/opencl/CLMemory.java @@ -1,7 +1,7 @@ package com.mbien.opencl; import com.mbien.opencl.gl.CLGLI; -import com.jogamp.gluegen.runtime.BufferFactory; +import com.jogamp.gluegen.runtime.Buffers; import com.jogamp.gluegen.runtime.PointerBuffer; import java.nio.Buffer; import java.nio.ByteBuffer; @@ -46,15 +46,15 @@ public abstract class CLMemory <B extends Buffer> extends CLObject implements CL protected static int sizeOfBufferElem(Buffer buffer) { if (buffer instanceof ByteBuffer) { - return BufferFactory.SIZEOF_BYTE; + return Buffers.SIZEOF_BYTE; } else if (buffer instanceof IntBuffer) { - return BufferFactory.SIZEOF_INT; + return Buffers.SIZEOF_INT; } else if (buffer instanceof ShortBuffer) { - return BufferFactory.SIZEOF_SHORT; + return Buffers.SIZEOF_SHORT; } else if (buffer instanceof FloatBuffer) { - return BufferFactory.SIZEOF_FLOAT; + return Buffers.SIZEOF_FLOAT; } else if (buffer instanceof DoubleBuffer) { - return BufferFactory.SIZEOF_DOUBLE; + return Buffers.SIZEOF_DOUBLE; } throw new RuntimeException("Unexpected buffer type " + buffer.getClass().getName()); } diff --git a/src/com/mbien/opencl/CLProgram.java b/src/com/mbien/opencl/CLProgram.java index ced89720..79195f78 100644 --- a/src/com/mbien/opencl/CLProgram.java +++ b/src/com/mbien/opencl/CLProgram.java @@ -2,7 +2,7 @@ package com.mbien.opencl; import com.mbien.opencl.util.CLProgramConfiguration; import com.mbien.opencl.util.CLUtil; -import com.jogamp.gluegen.runtime.BufferFactory; +import com.jogamp.gluegen.runtime.Buffers; import com.jogamp.gluegen.runtime.CPU; import com.jogamp.gluegen.runtime.PointerBuffer; import java.nio.ByteBuffer; @@ -43,7 +43,7 @@ public class CLProgram extends CLObject implements CLResource { static CLProgram create(CLContext context, String src) { - IntBuffer status = BufferFactory.newDirectByteBuffer(4).asIntBuffer(); + IntBuffer status = Buffers.newDirectByteBuffer(4).asIntBuffer(); // Create the program long id = context.cl.clCreateProgramWithSource(context.ID, 1, new String[] {src}, PointerBuffer.allocateDirect(1).put(src.length()), status); @@ -68,15 +68,15 @@ public class CLProgram extends CLObject implements CLResource { devices.put(device.ID); lengths.put(bytes.length); - codeBuffers[i] = BufferFactory.newDirectByteBuffer(bytes.length).put(bytes); + codeBuffers[i] = Buffers.newDirectByteBuffer(bytes.length).put(bytes); codeBuffers[i].rewind(); i++; } devices.rewind(); lengths.rewind(); - IntBuffer err = BufferFactory.newDirectByteBuffer(4).asIntBuffer(); -// IntBuffer status = BufferFactory.newDirectByteBuffer(binaries.size()*4).asIntBuffer(); + IntBuffer err = Buffers.newDirectByteBuffer(4).asIntBuffer(); +// IntBuffer status = Buffers.newDirectByteBuffer(binaries.size()*4).asIntBuffer(); long id = context.cl.clCreateProgramWithBinary(context.ID, devices.capacity(), devices, lengths, codeBuffers, /*status*/null, err); // while(status.remaining() != 0) { @@ -293,7 +293,7 @@ public class CLProgram extends CLObject implements CLResource { HashMap<String, CLKernel> newKernels = new HashMap<String, CLKernel>(); - IntBuffer numKernels = BufferFactory.newDirectByteBuffer(4).asIntBuffer(); + IntBuffer numKernels = Buffers.newDirectByteBuffer(4).asIntBuffer(); int ret = cl.clCreateKernelsInProgram(ID, 0, null, numKernels); checkForError(ret, "can not create kernels for program"); |