CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG => cl_prop::<cl_uint>(1),
CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT => cl_prop::<cl_uint>(1),
CL_DEVICE_PREFERRED_WORK_GROUP_SIZE_MULTIPLE => {
- cl_prop::<usize>(dev.subgroups() as usize)
+ cl_prop::<usize>(dev.subgroup_sizes()[0])
}
CL_DEVICE_PRINTF_BUFFER_SIZE => cl_prop::<usize>(dev.printf_buffer_size()),
CL_DEVICE_PROFILE => cl_prop(if dev.embedded {
use mesa_rust::pipe::screen::*;
use mesa_rust::pipe::transfer::*;
use mesa_rust_gen::*;
+use mesa_rust_util::math::SetBitIndices;
use mesa_rust_util::static_assert;
use rusticl_opencl_gen::*;
&self.screen
}
- pub fn subgroups(&self) -> u32 {
- ComputeParam::<u32>::compute_param(
+ pub fn subgroup_sizes(&self) -> Vec<usize> {
+ let subgroup_size = ComputeParam::<u32>::compute_param(
self.screen.as_ref(),
pipe_compute_cap::PIPE_COMPUTE_CAP_SUBGROUP_SIZE,
- )
+ );
+
+ SetBitIndices::from_msb(subgroup_size)
+ .map(|bit| 1 << bit)
+ .collect()
}
pub fn svm_supported(&self) -> bool {