hex.tree.xgboost.XGBoostGPULock Maven / Gradle / Ivy
package hex.tree.xgboost;
import java.util.HashMap;
import java.util.Map;
class XGBoostGPULock {
private static final Map LOCKS = new HashMap<>();
static XGBoostGPULock lock(int gpuId) {
if(!LOCKS.containsKey(gpuId)) {
synchronized (XGBoostGPULock.class) {
if(!LOCKS.containsKey(gpuId)) {
LOCKS.put(gpuId, new XGBoostGPULock());
}
}
}
return LOCKS.get(gpuId);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy