-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7bd5c20
commit e83db3d
Showing
3 changed files
with
32 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUCachingAllocatorUtils.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
#pragma once | ||
|
||
#include <c10/core/Allocator.h> | ||
#include <c10/core/Device.h> | ||
|
||
#include "csrc_dipu/runtime/core/DIPUStream.h" | ||
|
||
namespace dipu { | ||
size_t memoryReserved(const c10::Device& device); | ||
|
||
size_t memoryAllocated(const c10::Device& device); | ||
|
||
size_t maxMemoryReserved(const c10::Device& device); | ||
|
||
size_t maxMemoryAllocated(const c10::Device& device); | ||
|
||
void emptyCachedMem(); | ||
|
||
void initCachedAllocator(); | ||
|
||
void releaseAllDeviceMem(); | ||
|
||
void recordStream(const c10::DataPtr& ptr, DIPUStream stream); | ||
|
||
void recordStream(const at::Tensor& tensor, DIPUStream stream); | ||
|
||
} // namespace dipu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters