diff --git a/src/gallium/frontends/rusticl/api/kernel.rs b/src/gallium/frontends/rusticl/api/kernel.rs index 986ee434055..22679682094 100644 --- a/src/gallium/frontends/rusticl/api/kernel.rs +++ b/src/gallium/frontends/rusticl/api/kernel.rs @@ -101,13 +101,15 @@ unsafe impl CLInfoObj for cl_kernel { kernel.prog.devs[0] } } else { - Device::ref_from_raw(dev)? - }; + let dev = Device::ref_from_raw(dev)?; - // CL_INVALID_DEVICE if device is not in the list of devices associated with kernel - if !kernel.prog.devs.contains(&dev) { - return Err(CL_INVALID_DEVICE); - } + // CL_INVALID_DEVICE if device is not in the list of devices associated with kernel + if !kernel.prog.devs.contains(&dev) { + return Err(CL_INVALID_DEVICE); + } + + dev + }; match *q { CL_KERNEL_COMPILE_WORK_GROUP_SIZE => v.write::<[usize; 3]>(kernel.work_group_size()),