XPUContext.h 458 B

1234567891011121314151617181920
  1. #pragma once
  2. #include <ATen/Context.h>
  3. #include <c10/xpu/XPUFunctions.h>
  4. #include <c10/xpu/XPUStream.h>
  5. namespace at::xpu {
  6. // XPU is available if we compiled with XPU.
  7. inline bool is_available() {
  8. return c10::xpu::device_count() > 0;
  9. }
  10. TORCH_XPU_API DeviceProp* getCurrentDeviceProperties();
  11. TORCH_XPU_API DeviceProp* getDeviceProperties(DeviceIndex device);
  12. TORCH_XPU_API int32_t getGlobalIdxFromDevice(DeviceIndex device);
  13. } // namespace at::xpu