mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
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:
parent
4be2a49e02
commit
3aec638a8b
1 changed files with 8 additions and 6 deletions
|
|
@ -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()),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue