1 #ifndef HALIDE_DEVICEAPI_H 2 #define HALIDE_DEVICEAPI_H 3 4 /** \file 5 * Defines DeviceAPI. 6 */ 7 8 #include <string> 9 #include <vector> 10 11 namespace Halide { 12 13 /** An enum describing a type of device API. Used by schedules, and in 14 * the For loop IR node. */ 15 enum class DeviceAPI { 16 None, /// Used to denote for loops that run on the same device as the containing code. 17 Host, 18 Default_GPU, 19 CUDA, 20 OpenCL, 21 GLSL, 22 OpenGLCompute, 23 Metal, 24 Hexagon, 25 HexagonDma, 26 D3D12Compute, 27 }; 28 29 /** An array containing all the device apis. Useful for iterating 30 * through them. */ 31 const DeviceAPI all_device_apis[] = {DeviceAPI::None, 32 DeviceAPI::Host, 33 DeviceAPI::Default_GPU, 34 DeviceAPI::CUDA, 35 DeviceAPI::OpenCL, 36 DeviceAPI::GLSL, 37 DeviceAPI::OpenGLCompute, 38 DeviceAPI::Metal, 39 DeviceAPI::Hexagon, 40 DeviceAPI::HexagonDma, 41 DeviceAPI::D3D12Compute}; 42 43 } // namespace Halide 44 45 #endif // HALIDE_DEVICEAPI_H 46