mirror of
https://github.com/vosen/ZLUDA.git
synced 2025-08-19 17:00:34 +00:00
Remove trailing zeroes from end of ptx (#390)
This commit is contained in:
parent
f4cd545677
commit
74ff9ebf96
1 changed files with 7 additions and 1 deletions
|
@ -142,7 +142,7 @@ impl<'a> FatbinFile<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn decompress(&'a self) -> Result<Vec<u8>, FatbinError> {
|
pub unsafe fn decompress(&'a self) -> Result<Vec<u8>, FatbinError> {
|
||||||
let payload = if self
|
let mut payload = if self
|
||||||
.header
|
.header
|
||||||
.flags
|
.flags
|
||||||
.contains(FatbinFileHeaderFlags::CompressedLz4)
|
.contains(FatbinFileHeaderFlags::CompressedLz4)
|
||||||
|
@ -158,6 +158,12 @@ impl<'a> FatbinFile<'a> {
|
||||||
unsafe { self.get_payload().to_vec() }
|
unsafe { self.get_payload().to_vec() }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
while payload.last() == Some(&0) {
|
||||||
|
// remove trailing zeros
|
||||||
|
payload.pop();
|
||||||
|
}
|
||||||
|
|
||||||
Ok(payload)
|
Ok(payload)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue