aboutsummaryrefslogtreecommitdiffhomepage
path: root/zluda
diff options
context:
space:
mode:
authorAndrzej Janik <[email protected]>2021-08-07 15:21:45 +0200
committerAndrzej Janik <[email protected]>2021-08-07 15:21:45 +0200
commitfefdd528d5330a02897c28c19ff083e879533a78 (patch)
treeff6297ae1fff894bd13a6f9348486410b8ba1dd7 /zluda
parent20c9aa4f02013bf12889c3e73f78682e44c6e5ef (diff)
downloadZLUDA-fefdd528d5330a02897c28c19ff083e879533a78.tar.gz
ZLUDA-fefdd528d5330a02897c28c19ff083e879533a78.zip
Handle xnack suffix in device name
Diffstat (limited to 'zluda')
-rw-r--r--zluda/src/impl/module.rs7
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))