mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-03 18:38:11 +02:00
rusticl/kernel: take set kernel arguments into account for CL_KERNEL_LOCAL_MEM_SIZE
Cc: mesa-stable Reviewed-by @LingMan Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32875>
This commit is contained in:
parent
bd1a042046
commit
3a9b1baa80
1 changed files with 15 additions and 2 deletions
|
|
@ -1717,9 +1717,22 @@ impl Kernel {
|
|||
}
|
||||
|
||||
pub fn local_mem_size(&self, dev: &Device) -> cl_ulong {
|
||||
// TODO include args
|
||||
// TODO: take alignment into account?
|
||||
// this is purely informational so it shouldn't even matter
|
||||
self.builds.get(dev).unwrap()[NirKernelVariant::Default].shared_size as cl_ulong
|
||||
let local =
|
||||
self.builds.get(dev).unwrap()[NirKernelVariant::Default].shared_size as cl_ulong;
|
||||
let args: cl_ulong = self
|
||||
.arg_values()
|
||||
.iter()
|
||||
.map(|arg| match arg {
|
||||
Some(KernelArgValue::LocalMem(val)) => *val as cl_ulong,
|
||||
// If the local memory size, for any pointer argument to the kernel declared with
|
||||
// the __local address qualifier, is not specified, its size is assumed to be 0.
|
||||
_ => 0,
|
||||
})
|
||||
.sum();
|
||||
|
||||
local + args
|
||||
}
|
||||
|
||||
pub fn has_svm_devs(&self) -> bool {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue