rusticl/program: simplify active_kernels check

This removes one loop, also will allow us to cache the device builds in
the queue to optimize binding compute states.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33775>
This commit is contained in:
Karol Herbst 2025-02-27 12:17:21 +01:00 committed by Marge Bot
parent 67598775ad
commit 0c0c10a811

View file

@ -550,9 +550,9 @@ impl Program {
pub fn active_kernels(&self) -> bool {
self.build_info()
.builds
.kernel_info
.values()
.any(|b| b.kernels.values().any(|b| Arc::strong_count(b) > 1))
.any(|k| Arc::strong_count(k) > 1)
}
pub fn build(&self, devs: &[&'static Device], options: &str) -> bool {