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