public class CudaFullCachingProvider extends CudaCachingZeroProvider
CudaCachingZeroProvider.CacheHolder, CudaCachingZeroProvider.CachePreallocator
Modifier and Type | Field and Description |
---|---|
protected ConcurrentHashMap<Integer,ConcurrentHashMap<AllocationShape,CudaCachingZeroProvider.CacheHolder>> |
deviceCache |
protected long |
MAX_GPU_ALLOCATION |
protected long |
MAX_GPU_CACHE |
cacheDeviceHit, cacheDeviceMiss, cacheZeroHit, cacheZeroMiss, configuration, deviceCachedAmount, FORCED_CACHE_THRESHOLD, MAX_CACHED_MEMORY, MAX_SINGLE_ALLOCATION, PREALLOCATION_LIMIT, singleLock, zeroCache, zeroCachedAmount
DEVICE_RESERVED_SPACE, nativeOps, validator
Constructor and Description |
---|
CudaFullCachingProvider() |
Modifier and Type | Method and Description |
---|---|
protected void |
ensureDeviceCacheHolder(Integer deviceId,
AllocationShape shape)
This method checks, if storage contains holder for specified shape
|
void |
free(AllocationPoint point)
This method frees specific chunk of memory, described by AllocationPoint passed in
PLEASE NOTE: This method can actually ignore free, and keep released memory chunk for future reuse.
|
void |
init() |
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 |
purgeCache() |
ensureCacheHolder, printCacheStats
freeDevice, freeHost, pingDeviceForFreeMemory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
pingDeviceForFreeMemory
protected final long MAX_GPU_ALLOCATION
protected final long MAX_GPU_CACHE
protected volatile ConcurrentHashMap<Integer,ConcurrentHashMap<AllocationShape,CudaCachingZeroProvider.CacheHolder>> deviceCache
public void init()
public PointersPair malloc(AllocationShape shape, AllocationPoint point, AllocationStatus location)
malloc
in interface MemoryProvider
malloc
in class CudaCachingZeroProvider
shape
- shape of desired memory chunkpoint
- target AllocationPoint structurelocation
- either HOST or DEVICEpublic void free(AllocationPoint point)
free
in interface MemoryProvider
free
in class CudaCachingZeroProvider
point
- protected void ensureDeviceCacheHolder(Integer deviceId, AllocationShape shape)
deviceId
- shape
- public void purgeCache()
purgeCache
in interface MemoryProvider
purgeCache
in class CudaCachingZeroProvider
Copyright © 2016. All Rights Reserved.