summaryrefslogtreecommitdiffstats
path: root/src/com/mbien/opencl/CLInfoAccessor.java
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-03-30 17:19:15 +0200
committerMichael Bien <[email protected]>2010-03-30 17:19:15 +0200
commit9ec0937d729faade497a3d2a394f76992dcdaa45 (patch)
tree5ae54ffaf676f988609e66f6a88858f468f296bf /src/com/mbien/opencl/CLInfoAccessor.java
parent8b6228d7978c515d1d8de160c45fe52b77874779 (diff)
refactorings due to newly introduced Int64Buffer in gluegen.
Diffstat (limited to 'src/com/mbien/opencl/CLInfoAccessor.java')
-rw-r--r--src/com/mbien/opencl/CLInfoAccessor.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/com/mbien/opencl/CLInfoAccessor.java b/src/com/mbien/opencl/CLInfoAccessor.java
index 44eb5fe4..ea69db33 100644
--- a/src/com/mbien/opencl/CLInfoAccessor.java
+++ b/src/com/mbien/opencl/CLInfoAccessor.java
@@ -1,10 +1,10 @@
package com.mbien.opencl;
+import com.jogamp.gluegen.runtime.Buffers;
+import com.jogamp.gluegen.runtime.Int64Buffer;
import com.mbien.opencl.util.CLUtil;
-import com.jogamp.gluegen.runtime.PointerBuffer;
import java.nio.Buffer;
import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
import static com.mbien.opencl.CLException.*;
@@ -19,15 +19,15 @@ abstract class CLInfoAccessor {
@Override
protected ByteBuffer initialValue() {
- return ByteBuffer.allocateDirect(512).order(ByteOrder.nativeOrder());
+ return Buffers.newDirectByteBuffer(512);
}
};
- protected final static ThreadLocal<PointerBuffer> localPB = new ThreadLocal<PointerBuffer>() {
+ protected final static ThreadLocal<Int64Buffer> localPB = new ThreadLocal<Int64Buffer>() {
@Override
- protected PointerBuffer initialValue() {
- return PointerBuffer.allocateDirect(1);
+ protected Int64Buffer initialValue() {
+ return Int64Buffer.allocateDirect(1);
}
};
@@ -44,11 +44,11 @@ abstract class CLInfoAccessor {
public final String getString(int key) {
ByteBuffer buffer = localBB.get();
- PointerBuffer pbuffer = localPB.get();
- int ret = getInfo(key, buffer.capacity(), buffer, pbuffer);
+ Int64Buffer sizeBuffer = localPB.get();
+ int ret = getInfo(key, buffer.capacity(), buffer, sizeBuffer);
checkForError(ret, "error while asking for info string");
- int clSize = (int)pbuffer.get(0);
+ int clSize = (int)sizeBuffer.get(0);
byte[] array = new byte[clSize-1]; // last char is always null
buffer.get(array).rewind();
@@ -56,7 +56,7 @@ abstract class CLInfoAccessor {
}
- protected abstract int getInfo(int name, long valueSize, Buffer value, PointerBuffer valueSizeRet);
+ protected abstract int getInfo(int name, long valueSize, Buffer value, Int64Buffer valueSizeRet);
}