From 468928edc68896718f0a27b47d59ddad2c892967 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Fri, 22 Jan 2010 17:55:59 +0100 Subject: small win32 fix in build setup and 32bit compatibility fix for CLDevice. --- src/com/mbien/opencl/CLDevice.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/com/mbien/opencl/CLDevice.java') diff --git a/src/com/mbien/opencl/CLDevice.java b/src/com/mbien/opencl/CLDevice.java index e8d55eb1..44fbabfb 100644 --- a/src/com/mbien/opencl/CLDevice.java +++ b/src/com/mbien/opencl/CLDevice.java @@ -1,5 +1,6 @@ package com.mbien.opencl; +import com.sun.gluegen.runtime.CPU; import com.sun.gluegen.runtime.PointerBuffer; import java.nio.Buffer; import java.nio.ByteBuffer; @@ -443,7 +444,11 @@ public final class CLDevice { int[] array = new int[n]; for(int i = 0; i < array.length; i++) { - array[i] = (int)buffer.getLong(); + if(CPU.is32Bit()) { + array[i] = buffer.getInt(); + }else{ + array[i] = (int)buffer.getLong(); + } } buffer.rewind(); -- cgit v1.2.3