/** * Get the current device architecture * @return the major/minor version of * the current device */ public int getCurrentDeviceArchitecture() { int deviceId = Nd4j.getAffinityManager().getDeviceForCurrentThread(); if (!arch.containsKey(deviceId)) { int major = NativeOpsHolder.getInstance().getDeviceNativeOps().getDeviceMajor(new CudaPointer(deviceId)); int minor = NativeOpsHolder.getInstance().getDeviceNativeOps().getDeviceMinor(new CudaPointer(deviceId)); Integer cc = Integer.parseInt(new String("" + major + minor)); arch.put(deviceId, cc); return cc; } return arch.get(deviceId); }
/** * Get the current device architecture * @return the major/minor version of * the current device */ public int getCurrentDeviceArchitecture() { int deviceId = Nd4j.getAffinityManager().getDeviceForCurrentThread(); if (!arch.containsKey(deviceId)) { int major = NativeOpsHolder.getInstance().getDeviceNativeOps().getDeviceMajor(new CudaPointer(deviceId)); int minor = NativeOpsHolder.getInstance().getDeviceNativeOps().getDeviceMinor(new CudaPointer(deviceId)); Integer cc = Integer.parseInt(new String("" + major + minor)); arch.put(deviceId, cc); return cc; } return arch.get(deviceId); }
deviceProps.put(Nd4jEnvironment.CUDA_FREE_MEMORY_KEY, nativeOps.getDeviceFreeMemory(devPtr)); deviceProps.put(Nd4jEnvironment.CUDA_TOTAL_MEMORY_KEY, nativeOps.getDeviceTotalMemory(devPtr)); deviceProps.put(Nd4jEnvironment.CUDA_DEVICE_MAJOR_VERSION_KEY, (long) nativeOps.getDeviceMajor(devPtr)); deviceProps.put(Nd4jEnvironment.CUDA_DEVICE_MINOR_VERSION_KEY, (long) nativeOps.getDeviceMinor(devPtr));
deviceProps.put(Nd4jEnvironment.CUDA_FREE_MEMORY_KEY, nativeOps.getDeviceFreeMemory(devPtr)); deviceProps.put(Nd4jEnvironment.CUDA_TOTAL_MEMORY_KEY, nativeOps.getDeviceTotalMemory(devPtr)); deviceProps.put(Nd4jEnvironment.CUDA_DEVICE_MAJOR_VERSION_KEY, (long) nativeOps.getDeviceMajor(devPtr)); deviceProps.put(Nd4jEnvironment.CUDA_DEVICE_MINOR_VERSION_KEY, (long) nativeOps.getDeviceMinor(devPtr));
if (NativeOpsHolder.getInstance().getDeviceNativeOps().getDeviceMajor(new CudaPointer(0)) < 3) { throw new ND4JIllegalStateException("CUDA backend requires compute capatibility of 3.0 and above to run.");
if (NativeOpsHolder.getInstance().getDeviceNativeOps().getDeviceMajor(new CudaPointer(0)) < 3) { throw new ND4JIllegalStateException("CUDA backend requires compute capatibility of 3.0 and above to run.");