File size: 1,395 Bytes
d1d4335
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once

#include <ATen/core/CachingHostAllocator.h>
#include <ATen/xpu/XPUEvent.h>
#include <c10/core/Allocator.h>
#include <c10/util/Deprecated.h>
#include <c10/xpu/XPUStream.h>

namespace at::xpu {

C10_DEPRECATED_MESSAGE(
    "at::xpu::getCachingHostAllocator() is deprecated. Please use at::getHostAllocator(at::kXPU) instead.")
inline TORCH_XPU_API at::HostAllocator* getCachingHostAllocator() {
  return at::getHostAllocator(at::kXPU);
}

C10_DEPRECATED_MESSAGE(
    "at::xpu::CachingHostAllocator_recordEvent(...) is deprecated. Please use at::getHostAllocator(at::kXPU)->record_event(...) instead.")
inline TORCH_XPU_API bool CachingHostAllocator_recordEvent(

    void* ptr,

    void* ctx,

    c10::xpu::XPUStream stream) {
  return getHostAllocator(at::kXPU)->record_event(ptr, ctx, stream.unwrap());
}

C10_DEPRECATED_MESSAGE(
    "at::xpu::CachingHostAllocator_emptyCache() is deprecated. Please use at::getHostAllocator(at::kXPU)->empty_cache() instead.")
inline TORCH_XPU_API void CachingHostAllocator_emptyCache() {
  getHostAllocator(at::kXPU)->empty_cache();
}

C10_DEPRECATED_MESSAGE(
    "at::xpu::HostAlloc(...) is deprecated. Please use at::getHostAllocator(at::kXPU)->allocate(...) instead.")
inline TORCH_XPU_API at::DataPtr HostAlloc(size_t size) {
  return getHostAllocator(at::kXPU)->allocate(size);
}

} // namespace at::xpu