Bugfix: a NativeLong is 32bits on windows and might be 64bits on unix. A 'JavaLong' is always 64bits.

This commit is contained in:
Laurent Clouet
2014-12-10 15:27:12 +00:00
parent bc9a0e52d0
commit ac2d2227cb
2 changed files with 4 additions and 5 deletions

View File

@@ -24,7 +24,6 @@ import java.util.List;
import com.sheepit.client.os.OS;
import com.sun.jna.Native;
import com.sun.jna.NativeLong;
public class GPU {
public static List<GPUDevice> devices = null;
@@ -84,7 +83,7 @@ public class GPU {
continue;
}
NativeLong[] ram = new NativeLong[1];
long[] ram = new long[1];
result = cudalib.cuDeviceTotalMem(ram, num);
if (result != CUresult.CUDA_SUCCESS) {
@@ -92,7 +91,7 @@ public class GPU {
return false;
}
devices.add(new GPUDevice(new String(name).trim(), ram[0].longValue(), "CUDA_" + Integer.toString(num)));
devices.add(new GPUDevice(new String(name).trim(), ram[0], "CUDA_" + Integer.toString(num)));
}
return true;
}