summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--resources/clImplCustomCode.java42
-rw-r--r--src/com/mbien/opencl/CLContext.java6
-rw-r--r--src/com/mbien/opencl/CLImage2d.java4
-rw-r--r--src/com/mbien/opencl/CLImage3d.java4
-rw-r--r--src/com/mbien/opencl/CLKernel.java4
-rw-r--r--src/com/mbien/opencl/CLMemory.java12
-rw-r--r--src/com/mbien/opencl/CLProgram.java12
-rw-r--r--test/com/mbien/opencl/CLBufferTest.java2
-rw-r--r--test/com/mbien/opencl/CLCommandQueueTest.java2
-rw-r--r--test/com/mbien/opencl/HighLevelBindingTest.java2
-rw-r--r--test/com/mbien/opencl/LowLevelBindingTest.java2
11 files changed, 46 insertions, 46 deletions
diff --git a/resources/clImplCustomCode.java b/resources/clImplCustomCode.java
index c4d9c845..6e9863c6 100644
--- a/resources/clImplCustomCode.java
+++ b/resources/clImplCustomCode.java
@@ -17,10 +17,10 @@
System.err.println("WARNING: userData not yet implemented... ignoring");
return this.clCreateContext0(
- properties!=null?properties.getBuffer():null, BufferFactory.getDirectBufferByteOffset(properties),
- devices!=null?devices.remaining():0, devices!=null?devices.getBuffer():null, BufferFactory.getDirectBufferByteOffset(devices),
+ properties!=null?properties.getBuffer():null, Buffers.getDirectBufferByteOffset(properties),
+ devices!=null?devices.remaining():0, devices!=null?devices.getBuffer():null, Buffers.getDirectBufferByteOffset(devices),
null, null,
- errcode_ret, BufferFactory.getDirectBufferByteOffset(errcode_ret) );
+ errcode_ret, Buffers.getDirectBufferByteOffset(errcode_ret) );
}
private native long clCreateContext0(Object cl_context_properties, int props_offset, int numDevices, Object devices, int devices_offset, CreateContextCallback pfn_notify, Object userData, Object errcode_ret, int err_offset);
@@ -37,9 +37,9 @@
System.err.println("WARNING: userData not yet implemented... ignoring");
return this.clCreateContextFromType0(
- properties!=null?properties.getBuffer():null, BufferFactory.getDirectBufferByteOffset(properties),
+ properties!=null?properties.getBuffer():null, Buffers.getDirectBufferByteOffset(properties),
device_type, pfn_notify, null,
- errcode_ret, BufferFactory.getDirectBufferByteOffset(errcode_ret) );
+ errcode_ret, Buffers.getDirectBufferByteOffset(errcode_ret) );
}
private native long clCreateContextFromType0(Object properties, int props_offset, long device_type, CreateContextCallback pfn_notify, Object userData, Object errcode_ret, int err_offset);
@@ -57,7 +57,7 @@
System.err.println("WARNING: userData not yet implemented... ignoring");
return clBuildProgram0(program, deviceCount,
- deviceList!=null?deviceList.getBuffer():null, BufferFactory.getDirectBufferByteOffset(deviceList),
+ deviceList!=null?deviceList.getBuffer():null, Buffers.getDirectBufferByteOffset(deviceList),
options, cb, userData);
}
/** Entry point to C language function: <code> int32_t clBuildProgram(cl_program, uint32_t, cl_device_id * , const char * , void * ); </code> */
@@ -78,32 +78,32 @@
int num_events_in_wait_list,
com.jogamp.gluegen.runtime.PointerBuffer event_wait_list, com.jogamp.gluegen.runtime.PointerBuffer event, java.nio.IntBuffer errcode_ret) {
- if (!BufferFactory.isDirect(origin))
+ if (!Buffers.isDirect(origin))
throw new CLException("Argument \"origin\" was not a direct buffer");
- if (!BufferFactory.isDirect(range))
+ if (!Buffers.isDirect(range))
throw new CLException("Argument \"range\" was not a direct buffer");
- if (!BufferFactory.isDirect(image_row_pitch))
+ if (!Buffers.isDirect(image_row_pitch))
throw new CLException("Argument \"image_row_pitch\" was not a direct buffer");
- if (!BufferFactory.isDirect(image_slice_pitch))
+ if (!Buffers.isDirect(image_slice_pitch))
throw new CLException("Argument \"image_slice_pitch\" was not a direct buffer");
- if (!BufferFactory.isDirect(event_wait_list))
+ if (!Buffers.isDirect(event_wait_list))
throw new CLException("Argument \"event_wait_list\" was not a direct buffer");
- if (!BufferFactory.isDirect(event))
+ if (!Buffers.isDirect(event))
throw new CLException("Argument \"event\" was not a direct buffer");
- if (!BufferFactory.isDirect(errcode_ret))
+ if (!Buffers.isDirect(errcode_ret))
throw new CLException("Argument \"errcode_ret\" was not a direct buffer");
java.nio.ByteBuffer _res;
_res = clEnqueueMapImage0(command_queue, image, blocking_map, map_flags, origin!=null?origin.getBuffer():null,
- BufferFactory.getDirectBufferByteOffset(origin), range!=null?range.getBuffer():null,
- BufferFactory.getDirectBufferByteOffset(range), image_row_pitch!=null?image_row_pitch.getBuffer():null,
- BufferFactory.getDirectBufferByteOffset(image_row_pitch), image_slice_pitch!=null?image_slice_pitch.getBuffer():null,
- BufferFactory.getDirectBufferByteOffset(image_slice_pitch), num_events_in_wait_list,
- event_wait_list!=null?event_wait_list.getBuffer():null, BufferFactory.getDirectBufferByteOffset(event_wait_list),
- event!=null?event.getBuffer():null, BufferFactory.getDirectBufferByteOffset(event), errcode_ret,
- BufferFactory.getDirectBufferByteOffset(errcode_ret));
+ Buffers.getDirectBufferByteOffset(origin), range!=null?range.getBuffer():null,
+ Buffers.getDirectBufferByteOffset(range), image_row_pitch!=null?image_row_pitch.getBuffer():null,
+ Buffers.getDirectBufferByteOffset(image_row_pitch), image_slice_pitch!=null?image_slice_pitch.getBuffer():null,
+ Buffers.getDirectBufferByteOffset(image_slice_pitch), num_events_in_wait_list,
+ event_wait_list!=null?event_wait_list.getBuffer():null, Buffers.getDirectBufferByteOffset(event_wait_list),
+ event!=null?event.getBuffer():null, Buffers.getDirectBufferByteOffset(event), errcode_ret,
+ Buffers.getDirectBufferByteOffset(errcode_ret));
if (_res == null) return null;
- BufferFactory.nativeOrder(_res);
+ Buffers.nativeOrder(_res);
return _res;
}
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");
diff --git a/test/com/mbien/opencl/CLBufferTest.java b/test/com/mbien/opencl/CLBufferTest.java
index 306757e4..0c801c30 100644
--- a/test/com/mbien/opencl/CLBufferTest.java
+++ b/test/com/mbien/opencl/CLBufferTest.java
@@ -9,7 +9,7 @@ import org.junit.Test;
import static org.junit.Assert.*;
import static java.lang.System.*;
import static com.mbien.opencl.TestUtils.*;
-import static com.jogamp.gluegen.runtime.BufferFactory.*;
+import static com.jogamp.gluegen.runtime.Buffers.*;
/**
*
diff --git a/test/com/mbien/opencl/CLCommandQueueTest.java b/test/com/mbien/opencl/CLCommandQueueTest.java
index 5857bc46..2685182a 100644
--- a/test/com/mbien/opencl/CLCommandQueueTest.java
+++ b/test/com/mbien/opencl/CLCommandQueueTest.java
@@ -12,7 +12,7 @@ import static org.junit.Assert.*;
import static java.lang.System.*;
import static com.mbien.opencl.TestUtils.*;
import static com.mbien.opencl.CLEvent.*;
-import static com.jogamp.gluegen.runtime.BufferFactory.*;
+import static com.jogamp.gluegen.runtime.Buffers.*;
/**
*
diff --git a/test/com/mbien/opencl/HighLevelBindingTest.java b/test/com/mbien/opencl/HighLevelBindingTest.java
index e5bf657c..264b6af2 100644
--- a/test/com/mbien/opencl/HighLevelBindingTest.java
+++ b/test/com/mbien/opencl/HighLevelBindingTest.java
@@ -22,7 +22,7 @@ import org.junit.Test;
import static org.junit.Assert.*;
import static java.lang.System.*;
import static com.mbien.opencl.TestUtils.*;
-import static com.jogamp.gluegen.runtime.BufferFactory.*;
+import static com.jogamp.gluegen.runtime.Buffers.*;
/**
* Test testing the high level bindings.
diff --git a/test/com/mbien/opencl/LowLevelBindingTest.java b/test/com/mbien/opencl/LowLevelBindingTest.java
index a7ad57bc..4b585bac 100644
--- a/test/com/mbien/opencl/LowLevelBindingTest.java
+++ b/test/com/mbien/opencl/LowLevelBindingTest.java
@@ -13,7 +13,7 @@ import static org.junit.Assert.*;
import static java.lang.System.*;
import static com.mbien.opencl.TestUtils.*;
import static com.mbien.opencl.util.CLUtil.*;
-import static com.jogamp.gluegen.runtime.BufferFactory.*;
+import static com.jogamp.gluegen.runtime.Buffers.*;
/**
* Test testing the low level bindings.