summaryrefslogtreecommitdiffstats
path: root/src/com/mbien/opencl/CLPlatform.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/mbien/opencl/CLPlatform.java')
-rw-r--r--src/com/mbien/opencl/CLPlatform.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com/mbien/opencl/CLPlatform.java b/src/com/mbien/opencl/CLPlatform.java
index 85868387..b6b502b9 100644
--- a/src/com/mbien/opencl/CLPlatform.java
+++ b/src/com/mbien/opencl/CLPlatform.java
@@ -1,5 +1,6 @@
package com.mbien.opencl;
+import com.jogamp.gluegen.runtime.Int64Buffer;
import com.mbien.opencl.util.CLUtil;
import com.mbien.opencl.impl.CLImpl;
import com.jogamp.gluegen.runtime.PointerBuffer;
@@ -257,13 +258,14 @@ public final class CLPlatform {
* Returns a info string in exchange for a key (CL_PLATFORM_*).
*/
public String getInfoString(int key) {
- PointerBuffer pb = PointerBuffer.allocateDirect(1);
+ Int64Buffer size = Int64Buffer.allocateDirect(1);
+ // TODO use cache/query size
ByteBuffer bb = ByteBuffer.allocateDirect(512);
- int ret = cl.clGetPlatformInfo(ID, key, bb.capacity(), bb, pb);
+ int ret = cl.clGetPlatformInfo(ID, key, bb.capacity(), bb, size);
checkForError(ret, "can not receive info string");
- return CLUtil.clString2JavaString(bb, (int)pb.get(0));
+ return CLUtil.clString2JavaString(bb, (int)size.get(0));
}
@Override