From fefdd528d5330a02897c28c19ff083e879533a78 Mon Sep 17 00:00:00 2001 From: Andrzej Janik Date: Sat, 7 Aug 2021 15:21:45 +0200 Subject: [PATCH] Handle xnack suffix in device name --- zluda/src/impl/module.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zluda/src/impl/module.rs b/zluda/src/impl/module.rs index f2a453e..f6522f8 100644 --- a/zluda/src/impl/module.rs +++ b/zluda/src/impl/module.rs @@ -116,13 +116,18 @@ impl SpirvModule { path.push(x); path }); + let suffix = if let Some(suffix_idx) = device_name.find(':') { + suffix_idx + } else { + device_name.len() + }; let mut additional_path = PathBuf::from(Self::AMDGPU); additional_path.push("amdgcn"); additional_path.push("bitcode"); additional_path.push(format!( "{}{}{}", Self::AMDGPU_BITCODE_DEVICE_PREFIX, - &device_name[3..], + &device_name[3..suffix], ".bc" )); generic_paths.chain(std::iter::once(additional_path))