Index from 0

This commit is contained in:
Andrzej Janik 2021-04-12 01:07:45 +02:00
parent fedf88180a
commit a005c92c61

View file

@ -191,7 +191,7 @@ unsafe fn record_module_image(module: CUmodule, image: &str) {
unsafe fn try_dump_module_image(image: &str) -> Result<(), Box<dyn Error>> {
let mut dump_path = get_dump_dir()?;
dump_path.push(format!("module_{:04}.ptx", MODULES.as_ref().unwrap().len()));
dump_path.push(format!("module_{:04}.ptx", MODULES.as_ref().unwrap().len() - 1));
let mut file = File::create(dump_path)?;
file.write_all(image.as_bytes())?;
Ok(())