forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
THCCachingAllocator.h
26 lines (20 loc) · 1.1 KB
/
THCCachingAllocator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef THC_DEVICE_ALLOCATOR_INC
#define THC_DEVICE_ALLOCATOR_INC
#include <c10/cuda/CUDAStream.h>
#include <ATen/cuda/ATenCUDAGeneral.h>
#include <mutex>
#include <THC/THCGeneral.h>
THC_API c10::Allocator* THCCachingAllocator_get(void);
THC_API void THCCachingAllocator_emptyCache(void);
THC_API void THCCachingAllocator_cacheInfo(int dev_id, size_t* cachedAndFree, size_t* largestBlock);
THC_API void* THCCachingAllocator_getBaseAllocation(void *ptr, size_t *size);
THC_API void THCCachingAllocator_recordStream(void *ptr, at::cuda::CUDAStream stream);
THC_API uint64_t THCCachingAllocator_currentMemoryAllocated(int device);
THC_API uint64_t THCCachingAllocator_maxMemoryAllocated(int device);
THC_API void THCCachingAllocator_resetMaxMemoryAllocated(int device);
THC_API uint64_t THCCachingAllocator_currentMemoryCached(int device);
THC_API uint64_t THCCachingAllocator_maxMemoryCached(int device);
THC_API void THCCachingAllocator_resetMaxMemoryCached(int device);
THC_API std::mutex* THCCachingAllocator_getCudaFreeMutex();
AT_CUDA_API std::shared_ptr<void> THCCaching_CUDAIpcDevptr(std::string handle);
#endif