public static void main(String[] args) throws Exception { CudaEnvironment.getInstance().getConfiguration() .allowMultiGPU(true) .setMaximumDeviceCache(2L * 1024L * 1024L * 1024L) .allowCrossDeviceAccess(true);
@Override public void allowCrossDeviceAccess(boolean reallyAllow) { CudaEnvironment.getInstance().getConfiguration().allowCrossDeviceAccess(reallyAllow); } }
public void notifyConfigurationApplied() { configuration.updateDevice(); } }
@Override public void setAutoGcWindow(int windowMillis) { super.setAutoGcWindow(windowMillis); CudaEnvironment.getInstance().getConfiguration().setNoGcWindowMs(windowMillis); }
@Override public boolean isCrossDeviceAccessSupported() { return NativeOpsHolder.getInstance().getDeviceNativeOps().isP2PAvailable() && CudaEnvironment.getInstance().getConfiguration().isCrossDeviceAccessAllowed(); }
/** * This method returns set of available devices * @return */ @Override public Set<Integer> getAvailableDevices() { return new HashSet<>(configuration.getAvailableDevices()); }
public Configuration() { parseEnvironmentVariables(); }
private CudaEnvironment() { configuration = new Configuration(); }
/** * This method forces specific device to be used. All other devices present in system will be ignored. * * @param deviceId * @return */ public Configuration useDevice(@NonNull Integer deviceId) { return useDevices(deviceId); }
CudaEnvironment.getInstance().getConfiguration() .allowMultiGPU(true) .setMaximumDeviceCache(2L * 1024L * 1024L * 1024L) .allowCrossDeviceAccess(true);
@Override public void allowCrossDeviceAccess(boolean reallyAllow) { CudaEnvironment.getInstance().getConfiguration().allowCrossDeviceAccess(reallyAllow); } }
@Override public void setAutoGcWindow(int windowMillis) { super.setAutoGcWindow(windowMillis); CudaEnvironment.getInstance().getConfiguration().setNoGcWindowMs(windowMillis); }
/** * This method returns set of available devices * @return */ @Override public Set<Integer> getAvailableDevices() { return new HashSet<>(configuration.getAvailableDevices()); }
public void notifyConfigurationApplied() { configuration.updateDevice(); } }
public Configuration() { parseEnvironmentVariables(); }
private CudaEnvironment() { configuration = new Configuration(); }
CudaEnvironment.getInstance().getConfiguration() .allowMultiGPU(true) .setMaximumDeviceCache(2L * 1024L * 1024L * 1024L) .allowCrossDeviceAccess(true);
CudaEnvironment.getInstance().getConfiguration() .allowMultiGPU(true) .setMaximumDeviceCache(2L * 1024L * 1024L * 1024L) .allowCrossDeviceAccess(true);
CudaEnvironment.getInstance().getConfiguration() .allowMultiGPU(true) .setMaximumDeviceCache(2L * 1024L * 1024L * 1024L) .allowCrossDeviceAccess(true);
CudaEnvironment.getInstance().getConfiguration() .allowMultiGPU(true) .setMaximumDeviceCache(2L * 1024L * 1024L * 1024L) .allowCrossDeviceAccess(true);