Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/device/device.h
| Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | |||||
| enum DeviceType { | enum DeviceType { | ||||
| DEVICE_NONE = 0, | DEVICE_NONE = 0, | ||||
| DEVICE_CPU, | DEVICE_CPU, | ||||
| DEVICE_CUDA, | DEVICE_CUDA, | ||||
| DEVICE_MULTI, | DEVICE_MULTI, | ||||
| DEVICE_OPTIX, | DEVICE_OPTIX, | ||||
| DEVICE_HIP, | DEVICE_HIP, | ||||
| DEVICE_METAL, | |||||
| DEVICE_DUMMY, | DEVICE_DUMMY, | ||||
| }; | }; | ||||
| enum DeviceTypeMask { | enum DeviceTypeMask { | ||||
| DEVICE_MASK_CPU = (1 << DEVICE_CPU), | DEVICE_MASK_CPU = (1 << DEVICE_CPU), | ||||
| DEVICE_MASK_CUDA = (1 << DEVICE_CUDA), | DEVICE_MASK_CUDA = (1 << DEVICE_CUDA), | ||||
| DEVICE_MASK_OPTIX = (1 << DEVICE_OPTIX), | DEVICE_MASK_OPTIX = (1 << DEVICE_OPTIX), | ||||
| DEVICE_MASK_HIP = (1 << DEVICE_HIP), | DEVICE_MASK_HIP = (1 << DEVICE_HIP), | ||||
| DEVICE_MASK_METAL = (1 << DEVICE_METAL), | |||||
| DEVICE_MASK_ALL = ~0 | DEVICE_MASK_ALL = ~0 | ||||
| }; | }; | ||||
| #define DEVICE_MASK(type) (DeviceTypeMask)(1 << type) | #define DEVICE_MASK(type) (DeviceTypeMask)(1 << type) | ||||
| class DeviceInfo { | class DeviceInfo { | ||||
| public: | public: | ||||
| DeviceType type; | DeviceType type; | ||||
| ▲ Show 20 Lines • Show All 205 Lines • ▼ Show 20 Lines | |||||
| private: | private: | ||||
| /* Indicted whether device types and devices lists were initialized. */ | /* Indicted whether device types and devices lists were initialized. */ | ||||
| static bool need_types_update, need_devices_update; | static bool need_types_update, need_devices_update; | ||||
| static thread_mutex device_mutex; | static thread_mutex device_mutex; | ||||
| static vector<DeviceInfo> cuda_devices; | static vector<DeviceInfo> cuda_devices; | ||||
| static vector<DeviceInfo> optix_devices; | static vector<DeviceInfo> optix_devices; | ||||
| static vector<DeviceInfo> cpu_devices; | static vector<DeviceInfo> cpu_devices; | ||||
| static vector<DeviceInfo> hip_devices; | static vector<DeviceInfo> hip_devices; | ||||
| static vector<DeviceInfo> metal_devices; | |||||
| static uint devices_initialized_mask; | static uint devices_initialized_mask; | ||||
| }; | }; | ||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||
| #endif /* __DEVICE_H__ */ | #endif /* __DEVICE_H__ */ | ||||