public class CudaDirectProvider extends Object implements MemoryProvider
Modifier and Type | Field and Description |
---|---|
protected static long |
DEVICE_RESERVED_SPACE |
protected NativeOps |
nativeOps |
protected ConcurrentHashMap<Long,Integer> |
validator |
Constructor and Description |
---|
CudaDirectProvider() |
Modifier and Type | Method and Description |
---|---|
void |
free(AllocationPoint point)
This method frees specific chunk of memory, described by AllocationPoint passed in
|
protected void |
freeDevice(org.bytedeco.javacpp.Pointer pointer,
int deviceId) |
protected void |
freeHost(org.bytedeco.javacpp.Pointer pointer) |
PointersPair |
malloc(AllocationShape shape,
AllocationPoint point,
AllocationStatus location)
This method provides PointersPair to memory chunk specified by AllocationShape
|
boolean |
pingDeviceForFreeMemory(Integer deviceId,
long requiredMemory)
This method checks specified device for specified amount of memory
|
void |
purgeCache() |
protected static final long DEVICE_RESERVED_SPACE
protected NativeOps nativeOps
protected volatile ConcurrentHashMap<Long,Integer> validator
public PointersPair malloc(AllocationShape shape, AllocationPoint point, AllocationStatus location)
malloc
in interface MemoryProvider
shape
- shape of desired memory chunkpoint
- target AllocationPoint structurelocation
- either HOST or DEVICEpublic void free(AllocationPoint point)
free
in interface MemoryProvider
point
- public boolean pingDeviceForFreeMemory(Integer deviceId, long requiredMemory)
pingDeviceForFreeMemory
in interface MemoryProvider
deviceId
- requiredMemory
- protected void freeHost(org.bytedeco.javacpp.Pointer pointer)
protected void freeDevice(org.bytedeco.javacpp.Pointer pointer, int deviceId)
public void purgeCache()
purgeCache
in interface MemoryProvider
Copyright © 2016. All Rights Reserved.