rusticl/kernel: take set kernel arguments into account for CL_KERNEL_LOCAL_MEM_SIZE
Cc: mesa-stable
Reviewed-by @LingMan
(cherry picked from commit 3a9b1baa80
)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33113>
This commit is contained in:

committed by
Dylan Baker

parent
f65e49341b
commit
798cb57680
@@ -1104,7 +1104,7 @@
|
|||||||
"description": "rusticl/kernel: take set kernel arguments into account for CL_KERNEL_LOCAL_MEM_SIZE",
|
"description": "rusticl/kernel: take set kernel arguments into account for CL_KERNEL_LOCAL_MEM_SIZE",
|
||||||
"nominated": true,
|
"nominated": true,
|
||||||
"nomination_type": 1,
|
"nomination_type": 1,
|
||||||
"resolution": 0,
|
"resolution": 1,
|
||||||
"main_sha": null,
|
"main_sha": null,
|
||||||
"because_sha": null,
|
"because_sha": null,
|
||||||
"notes": null
|
"notes": null
|
||||||
|
@@ -1713,9 +1713,22 @@ impl Kernel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn local_mem_size(&self, dev: &Device) -> cl_ulong {
|
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
|
// 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 {
|
pub fn has_svm_devs(&self) -> bool {
|
||||||
|
Reference in New Issue
Block a user