Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Member Functions | Data Fields
c10::cuda::CUDACachingAllocator::THCCachingAllocator Struct Reference

Public Member Functions

DeviceStats & get_stats_for_device (int device)
void malloc (void **devPtr, size_t size, cudaStream_t stream)
 allocates a block which is safe to use from the provided stream
void free (void *ptr)
void emptyCache ()
 returns cached blocks to the system allocator
void * getBaseAllocation (void *ptr, size_t *outSize)
void cacheInfoAux (BlockPool &blocks, int dev_id, size_t *total, size_t *largest)
void cacheInfo (int dev_id, size_t *total, size_t *largest)
void recordStream (void *ptr, cuda::CUDAStream stream)
void free_block (Block *block)
 moves a block into a pool of cached free blocks
void try_merge_blocks (Block *dst, Block *src, BlockPool &pool)
 combine previously split blocks
BlockPool & get_pool (size_t size)
bool should_split (Block *block, size_t size)
size_t round_size (size_t size)
size_t get_allocation_size (size_t size)
cudaError_t cuda_malloc_retry (int device, void **devPtr, size_t size)
void free_cached_blocks (int device)
void free_blocks (BlockPool &blocks, BlockPool::iterator it, BlockPool::iterator end)
Block * find_allocated_block (void *ptr)
void insert_events (Block *block)
void process_events ()

Data Fields

std::vector< DeviceStats > device_stats
std::mutex mutex
std::mutex cuda_free_mutex
BlockPool large_blocks
BlockPool small_blocks
std::unordered_map< void *, Block * > allocated_blocks
std::deque< std::pair< cudaEvent_t, Block * > > cuda_events

Detailed Description

Definition at line 151 of file CUDACachingAllocator.cpp.

The documentation for this struct was generated from the following file: