diff --git a/src/gallium/frontends/rusticl/core/kernel.rs b/src/gallium/frontends/rusticl/core/kernel.rs index 2d35682fc43..f1dde309fa2 100644 --- a/src/gallium/frontends/rusticl/core/kernel.rs +++ b/src/gallium/frontends/rusticl/core/kernel.rs @@ -803,7 +803,14 @@ fn convert_spirv_to_nir( assert!(attributes_string_set.len() == 1); let args = args_set.into_iter().next().unwrap(); let internal_args = internal_args_set.into_iter().next().unwrap(); - let attributes_string = attributes_string_set.into_iter().next().unwrap(); + + // spec: For kernels not created from OpenCL C source and the clCreateProgramWithSource API call + // the string returned from this query [CL_KERNEL_ATTRIBUTES] will be empty. + let attributes_string = if p.is_src() { + attributes_string_set.into_iter().next().unwrap() + } else { + String::new() + }; (nirs, args, internal_args, attributes_string) } diff --git a/src/gallium/frontends/rusticl/core/program.rs b/src/gallium/frontends/rusticl/core/program.rs index 15c4a773d6a..42d2f8a8415 100644 --- a/src/gallium/frontends/rusticl/core/program.rs +++ b/src/gallium/frontends/rusticl/core/program.rs @@ -591,4 +591,8 @@ impl Program { pub fn is_binary(&self) -> bool { self.src.to_bytes().is_empty() && self.il.is_empty() } + + pub fn is_src(&self) -> bool { + !self.src.to_bytes().is_empty() + } }