),
CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS => cl_prop::<bool>(false),
CL_DEVICE_SVM_CAPABILITIES => cl_prop::<cl_device_svm_capabilities>(0),
- CL_DEVICE_TYPE => cl_prop::<cl_device_type>(dev.device_type()),
+ CL_DEVICE_TYPE => cl_prop::<cl_device_type>(dev.device_type(false)),
CL_DEVICE_VENDOR => cl_prop(dev.screen().device_vendor()),
CL_DEVICE_VENDOR_ID => cl_prop::<cl_uint>(dev.vendor_id()),
CL_DEVICE_VERSION => cl_prop::<String>(format!("OpenCL {}", dev.cl_version.api_str())),
pub fn get_devs_for_type(device_type: cl_device_type) -> Vec<&'static Arc<Device>> {
devs()
.iter()
- .filter(|d| device_type & d.device_type() != 0)
+ .filter(|d| device_type & d.device_type(true) != 0)
.collect()
}
.param(pipe_cap::PIPE_CAP_MAX_SHADER_BUFFER_SIZE_UINT) as u64
}
- pub fn device_type(&self) -> cl_device_type {
+ pub fn device_type(&self, internal: bool) -> cl_device_type {
if self.custom {
return CL_DEVICE_TYPE_CUSTOM as cl_device_type;
}
- (match self.screen.device_type() {
+ let mut res = match self.screen.device_type() {
pipe_loader_device_type::PIPE_LOADER_DEVICE_SOFTWARE => CL_DEVICE_TYPE_CPU,
- pipe_loader_device_type::PIPE_LOADER_DEVICE_PCI => {
- CL_DEVICE_TYPE_GPU | CL_DEVICE_TYPE_DEFAULT
- }
- pipe_loader_device_type::PIPE_LOADER_DEVICE_PLATFORM => {
- CL_DEVICE_TYPE_GPU | CL_DEVICE_TYPE_DEFAULT
- }
+ pipe_loader_device_type::PIPE_LOADER_DEVICE_PCI => CL_DEVICE_TYPE_GPU,
+ pipe_loader_device_type::PIPE_LOADER_DEVICE_PLATFORM => CL_DEVICE_TYPE_GPU,
pipe_loader_device_type::NUM_PIPE_LOADER_DEVICE_TYPES => CL_DEVICE_TYPE_CUSTOM,
- }) as cl_device_type
+ };
+
+ if internal && res == CL_DEVICE_TYPE_GPU {
+ res |= CL_DEVICE_TYPE_DEFAULT;
+ }
+
+ res as cl_device_type
}
pub fn doubles_supported(&self) -> bool {