@@ -37,8 +37,8 @@ inline void setMemoryFraction(double fraction, c10::DeviceIndex device) {
3737 return get ()->setMemoryFraction (fraction, device);
3838}
3939
40- inline void emptyCache (MempoolId_t mempool_id = { 0 , 0 } ) {
41- return get ()->emptyCache (mempool_id );
40+ inline void emptyCache () {
41+ return get ()->emptyCache ();
4242}
4343
4444inline void enable (bool value) {
@@ -70,8 +70,8 @@ inline void resetPeakStats(c10::DeviceIndex device) {
7070 return get ()->resetPeakStats (device);
7171}
7272
73- inline HIPCachingAllocator::SnapshotInfo snapshot (MempoolId_t mempool_id = { 0 , 0 } ) {
74- return get ()->snapshot (mempool_id );
73+ inline HIPCachingAllocator::SnapshotInfo snapshot () {
74+ return get ()->snapshot ();
7575}
7676
7777inline std::shared_ptr<HIPCachingAllocator::AllocatorState> getCheckpointState (
@@ -101,25 +101,16 @@ inline void recordHistory(
101101 bool enabled,
102102 HIPCachingAllocator::CreateContextFn context_recorder,
103103 size_t alloc_trace_max_entries,
104- HIPCachingAllocator::RecordContext when,
105- bool clearHistory) {
104+ HIPCachingAllocator::RecordContext when) {
106105 return get ()->recordHistory (
107- enabled, context_recorder, alloc_trace_max_entries, when, clearHistory );
106+ enabled, context_recorder, alloc_trace_max_entries, when);
108107}
109108
110109inline void recordAnnotation (
111110 const std::vector<std::pair<std::string, std::string>>& md) {
112111 return get ()->recordAnnotation (md);
113112}
114113
115- inline void pushCompileContext (std::string& md) {
116- return get ()->pushCompileContext (md);
117- }
118-
119- inline void popCompileContext () {
120- return get ()->popCompileContext ();
121- }
122-
123114inline bool isHistoryEnabled () {
124115 return get ()->isHistoryEnabled ();
125116}
@@ -144,15 +135,10 @@ inline void releasePool(c10::DeviceIndex device, MempoolId_t mempool_id) {
144135 return get ()->releasePool (device, mempool_id);
145136}
146137
147- inline void createOrIncrefPool (
138+ inline void ensureExistsAndIncrefPool (
148139 c10::DeviceIndex device,
149- MempoolId_t mempool_id,
150- HIPCachingAllocator::HIPAllocator* allocator_ptr = nullptr ) {
151- get ()->createOrIncrefPool (device, mempool_id, allocator_ptr);
152- }
153-
154- inline void setUseOnOOM (c10::DeviceIndex device, MempoolId_t mempool_id) {
155- get ()->setUseOnOOM (device, mempool_id);
140+ MempoolId_t mempool_id) {
141+ get ()->ensureExistsAndIncrefPool (device, mempool_id);
156142}
157143
158144inline int getPoolUseCount (c10::DeviceIndex device, MempoolId_t mempool_id) {
0 commit comments