xref: /aosp_15_r20/external/pytorch/aten/src/ATen/hip/impl/HIPCachingAllocatorMasqueradingAsCUDA.cpp (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1 #include <c10/core/Allocator.h>
2 #include <ATen/hip/impl/HIPCachingAllocatorMasqueradingAsCUDA.h>
3 
4 namespace c10 { namespace hip {
5 namespace HIPCachingAllocatorMasqueradingAsCUDA {
6 
get()7 Allocator* get() {
8   static HIPAllocatorMasqueradingAsCUDA allocator(HIPCachingAllocator::get());
9   return &allocator;
10 }
11 
recordStreamMasqueradingAsCUDA(const DataPtr & ptr,HIPStreamMasqueradingAsCUDA stream)12 void recordStreamMasqueradingAsCUDA(const DataPtr& ptr, HIPStreamMasqueradingAsCUDA stream) {
13   HIPCachingAllocator::recordStream(ptr, stream.hip_stream());
14 }
15 
16 } // namespace HIPCachingAllocatorMasqueradingAsCUDA
17 }} // namespace c10::hip
18