public class LimitedContextPool extends BasicContextPool
Modifier and Type | Field and Description |
---|---|
protected Map<Long,CudaContext> |
acquired |
protected Map<Integer,org.nd4j.jita.allocator.context.impl.LimitedContextPool.ResourceGarbageCollectorThread> |
collectors |
protected AtomicInteger |
currentPoolSize |
protected Map<Integer,LinkedBlockingQueue<CudaContext>> |
pool |
protected Map<Integer,ReferenceQueue<Thread>> |
queueMap |
contextsForDevices, contextsPool, cublasPool, cuPool, lock, logger, MAX_STREAMS_PER_DEVICE, nativeOps
Constructor and Description |
---|
LimitedContextPool() |
Modifier and Type | Method and Description |
---|---|
CudaContext |
acquireContextForDevice(Integer deviceId) |
ContextPack |
acquireContextPackForDevice(Integer deviceId) |
protected void |
addResourcesToPool(int numResources) |
protected void |
fillPoolWithResources(int numResources,
boolean restoreDevice) |
CudaContext |
getContextForDevice(Integer deviceId) |
containsContextForThread, createNewContext, createNewCublasHandle, createNewCublasHandle, createNewStream, getCuContextForDevice, getDeviceBuffers, resetPool
protected Map<Integer,LinkedBlockingQueue<CudaContext>> pool
protected Map<Long,CudaContext> acquired
protected AtomicInteger currentPoolSize
protected Map<Integer,org.nd4j.jita.allocator.context.impl.LimitedContextPool.ResourceGarbageCollectorThread> collectors
protected Map<Integer,ReferenceQueue<Thread>> queueMap
protected void addResourcesToPool(int numResources)
protected void fillPoolWithResources(int numResources, boolean restoreDevice)
public CudaContext acquireContextForDevice(Integer deviceId)
acquireContextForDevice
in interface ContextPool
acquireContextForDevice
in class BasicContextPool
public ContextPack acquireContextPackForDevice(Integer deviceId)
acquireContextPackForDevice
in interface ContextPool
acquireContextPackForDevice
in class BasicContextPool
public CudaContext getContextForDevice(Integer deviceId)
getContextForDevice
in class BasicContextPool
Copyright © 2016. All Rights Reserved.