diff options
author | Andrzej Janik <[email protected]> | 2021-08-07 15:21:45 +0200 |
---|---|---|
committer | Andrzej Janik <[email protected]> | 2021-08-07 15:21:45 +0200 |
commit | fefdd528d5330a02897c28c19ff083e879533a78 (patch) | |
tree | ff6297ae1fff894bd13a6f9348486410b8ba1dd7 | |
parent | 20c9aa4f02013bf12889c3e73f78682e44c6e5ef (diff) | |
download | ZLUDA-fefdd528d5330a02897c28c19ff083e879533a78.tar.gz ZLUDA-fefdd528d5330a02897c28c19ff083e879533a78.zip |
Handle xnack suffix in device name
-rw-r--r-- | zluda/src/impl/module.rs | 7 |
1 files changed, 6 insertions, 1 deletions
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)) |