aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2011-05-11 02:55:33 +0200
committerMichael Bien <[email protected]>2011-05-11 02:55:33 +0200
commitd9066dda35bc633f8b910ab56b8cbcfff61e6662 (patch)
tree7e5e26a83f1a13b4a8b80a30394003b3cf0c2238
parent1c38b7ef96910260b64843214279ac4683005609 (diff)
fixed old TODO + better toString() formatting.
-rw-r--r--src/com/jogamp/opencl/CLPlatform.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/com/jogamp/opencl/CLPlatform.java b/src/com/jogamp/opencl/CLPlatform.java
index 611513a8..4637a114 100644
--- a/src/com/jogamp/opencl/CLPlatform.java
+++ b/src/com/jogamp/opencl/CLPlatform.java
@@ -510,11 +510,13 @@ public final class CLPlatform {
* Returns a info string in exchange for a key (CL_PLATFORM_*).
*/
public String getInfoString(int key) {
+
NativeSizeBuffer size = NativeSizeBuffer.allocateDirect(1);
- // TODO use cache/query size
- ByteBuffer bb = ByteBuffer.allocateDirect(512);
+ int ret = cl.clGetPlatformInfo(ID, key, 0, null, size);
+ checkForError(ret, "can not receive info string");
- int ret = cl.clGetPlatformInfo(ID, key, bb.capacity(), bb, size);
+ ByteBuffer bb = ByteBuffer.allocateDirect((int)size.get(0));
+ ret = cl.clGetPlatformInfo(ID, key, bb.capacity(), bb, null);
checkForError(ret, "can not receive info string");
return CLUtil.clString2JavaString(bb, (int)size.get(0));
@@ -522,10 +524,10 @@ public final class CLPlatform {
@Override
public String toString() {
- return "CLPlatform [name:" + getName()
- +" vendor:"+getVendor()
- +" profile:"+getProfile()
- +" version:"+getVersion()+"]";
+ return "CLPlatform [name: " + getName()
+ +", vendor: "+getVendor()
+ +", profile: "+getProfile()
+ +", version: "+getVersion()+"]";
}
@Override