summaryrefslogtreecommitdiffstats
path: root/src/com/mbien/opencl/CLProgram.java
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2009-10-22 13:03:53 +0200
committerMichael Bien <[email protected]>2009-10-22 13:03:53 +0200
commit503845224a820c0b9ce9204aa6215519f6b93c36 (patch)
treeb675747824468377685a4e6408a269b43b78c9f1 /src/com/mbien/opencl/CLProgram.java
parentb3881a0924ecbe17cf27cededeae8df40b2d6933 (diff)
32bit compatibility.
Diffstat (limited to 'src/com/mbien/opencl/CLProgram.java')
-rw-r--r--src/com/mbien/opencl/CLProgram.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/mbien/opencl/CLProgram.java b/src/com/mbien/opencl/CLProgram.java
index 566ae6b2..70656373 100644
--- a/src/com/mbien/opencl/CLProgram.java
+++ b/src/com/mbien/opencl/CLProgram.java
@@ -1,5 +1,6 @@
package com.mbien.opencl;
+import com.sun.gluegen.runtime.CPU;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Collections;
@@ -158,10 +159,10 @@ public class CLProgram {
ret = cl.clGetProgramInfo(ID, CL.CL_PROGRAM_DEVICES, bb.capacity(), bb, null, 0);
checkForError(ret, "on clGetProgramInfo");
- int count = bb.capacity() / 8; // TODO sizeof cl_device
+ int count = bb.capacity() / (CPU.is32Bit()?4:8);
CLDevice[] devices = new CLDevice[count];
for (int i = 0; i < count; i++) {
- devices[i] = context.getCLDevice(bb.getLong());
+ devices[i] = context.getCLDevice(CPU.is32Bit()?bb.getInt():bb.getLong());
}
return devices;