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. --- nbproject/genfiles.properties | 2 +- nbproject/project.properties | 3 ++- src/com/mbien/opencl/CLDevice.java | 7 ++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties index 9fc2d361..5fa8127d 100644 --- a/nbproject/genfiles.properties +++ b/nbproject/genfiles.properties @@ -5,4 +5,4 @@ build.xml.stylesheet.CRC32=958a1d3e@1.24.0.45 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=174e0dcd nbproject/build-impl.xml.script.CRC32=eeff7626 -nbproject/build-impl.xml.stylesheet.CRC32=576378a2@1.33.0.45 +nbproject/build-impl.xml.stylesheet.CRC32=576378a2@1.32.1.45 diff --git a/nbproject/project.properties b/nbproject/project.properties index cda7bf22..eab4a1e4 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -20,6 +20,7 @@ debug.test.classpath=\ dist.dir=dist dist.jar=${dist.dir}/jocl.jar dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= excludes= #default value, overwrite this or pass it as -D ant property if required @@ -76,7 +77,7 @@ run.classpath=\ # (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value # or test-sys-prop.name=value to set system properties for unit tests): run.jvmargs=-Xmx256m -Djava.library.path=\ - "${basedir}/build/natives/jocl:\ + "${basedir}/build/natives/jocl${path.separator}\ ${gluegen.root}/build/obj" run.test.classpath=\ ${javac.test.classpath}:\ 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