rusticl: remove unnecessary check for device in kernel list

There is no need to verify that `kernel.prog.devs` contains a device
when that device ref was pulled from `kernel.prog.devs` immediately
beforehand.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34167>
This commit is contained in:
Seán de Búrca 2025-03-25 15:16:52 -07:00 committed by Marge Bot
parent 4be2a49e02
commit 3aec638a8b

View file

@ -101,13 +101,15 @@ unsafe impl CLInfoObj<cl_kernel_work_group_info, cl_device_id> 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()),