All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hex.tree.xgboost.XGBoostGPULock Maven / Gradle / Ivy

There is a newer version: 3.46.0.6
Show newest version
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