public class CudaCachingZeroProvider extends CudaDirectProvider implements MemoryProvider
Modifier and Type | Class and Description |
---|---|
protected class |
CudaCachingZeroProvider.CacheHolder |
protected class |
CudaCachingZeroProvider.CachePreallocator |
Modifier and Type | Field and Description |
---|---|
protected AtomicLong |
cacheDeviceHit |
protected AtomicLong |
cacheDeviceMiss |
protected AtomicLong |
cacheZeroHit |
protected AtomicLong |
cacheZeroMiss |
protected Configuration |
configuration |
protected List<AtomicLong> |
deviceCachedAmount |
protected long |
FORCED_CACHE_THRESHOLD |
protected long |
MAX_CACHED_MEMORY |
protected long |
MAX_SINGLE_ALLOCATION |
protected int |
PREALLOCATION_LIMIT |
protected Semaphore |
singleLock |
protected ConcurrentHashMap<AllocationShape,CudaCachingZeroProvider.CacheHolder> |
zeroCache |
protected AtomicLong |
zeroCachedAmount |
DEVICE_RESERVED_SPACE, nativeOps, validator
Constructor and Description |
---|
CudaCachingZeroProvider() |
Modifier and Type | Method and Description |
---|---|
protected void |
ensureCacheHolder(AllocationShape shape) |
void |
free(AllocationPoint point)
This method frees specific chunk of memory, described by AllocationPoint passed in.
|
PointersPair |
malloc(AllocationShape shape,
AllocationPoint point,
AllocationStatus location)
This method provides PointersPair to memory chunk specified by AllocationShape
PLEASE NOTE: This method can actually ignore malloc request, and give out previously cached free memory chunk with equal shape.
|
void |
printCacheStats() |
void |
purgeCache() |
freeDevice, freeHost, pingDeviceForFreeMemory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
pingDeviceForFreeMemory
protected final Configuration configuration
protected volatile ConcurrentHashMap<AllocationShape,CudaCachingZeroProvider.CacheHolder> zeroCache
protected final AtomicLong cacheZeroHit
protected final AtomicLong cacheZeroMiss
protected final AtomicLong cacheDeviceHit
protected final AtomicLong cacheDeviceMiss
protected final AtomicLong zeroCachedAmount
protected List<AtomicLong> deviceCachedAmount
protected final Semaphore singleLock
protected final long MAX_SINGLE_ALLOCATION
protected final long MAX_CACHED_MEMORY
protected final long FORCED_CACHE_THRESHOLD
protected final int PREALLOCATION_LIMIT
public PointersPair malloc(AllocationShape shape, AllocationPoint point, AllocationStatus location)
malloc
in interface MemoryProvider
malloc
in class CudaDirectProvider
shape
- shape of desired memory chunkpoint
- target AllocationPoint structurelocation
- either HOST or DEVICEprotected void ensureCacheHolder(AllocationShape shape)
public void free(AllocationPoint point)
free
in interface MemoryProvider
free
in class CudaDirectProvider
point
- public void printCacheStats()
public void purgeCache()
purgeCache
in interface MemoryProvider
purgeCache
in class CudaDirectProvider
Copyright © 2016. All Rights Reserved.