XPUDevice.h 267 B

12345678910111213
  1. #pragma once
  2. #include <ATen/Context.h>
  3. #include <c10/xpu/XPUFunctions.h>
  4. namespace at::xpu {
  5. inline Device getDeviceFromPtr(void* ptr) {
  6. auto device = c10::xpu::get_device_idx_from_pointer(ptr);
  7. return {c10::DeviceType::XPU, device};
  8. }
  9. } // namespace at::xpu