File size: 267 Bytes
d1ceb73
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#pragma once

#include <ATen/Context.h>
#include <c10/xpu/XPUFunctions.h>

namespace at::xpu {

inline Device getDeviceFromPtr(void* ptr) {
  auto device = c10::xpu::get_device_idx_from_pointer(ptr);
  return {c10::DeviceType::XPU, device};
}

} // namespace at::xpu