diff --git a/Cargo.lock b/Cargo.lock index b0f2605..f627511 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -104,9 +104,9 @@ checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bpaf" -version = "0.9.18" +version = "0.9.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4de4d74c5891642753c67ab88f58d971a68dd98673b69689a8c24ce3ec78a412" +checksum = "4848ed5727d39a7573551c205bcb1ccd88c8cad4ed2c80f62e2316f208196b8d" dependencies = [ "bpaf_derive", ] diff --git a/compiler/Cargo.toml b/compiler/Cargo.toml index ebbb314..66d4123 100644 --- a/compiler/Cargo.toml +++ b/compiler/Cargo.toml @@ -11,7 +11,7 @@ path = "src/main.rs" [dependencies] amd_comgr-sys = { path = "../ext/amd_comgr-sys" } -bpaf = { version = "0.9.18", features = ["derive"] } +bpaf = { version = "0.9.19", features = ["derive"] } comgr = { path = "../comgr" } hip_runtime-sys = { path = "../ext/hip_runtime-sys" } ptx = { path = "../ptx" } diff --git a/compiler/src/main.rs b/compiler/src/main.rs index 3df41fb..3a3d7e3 100644 --- a/compiler/src/main.rs +++ b/compiler/src/main.rs @@ -17,6 +17,10 @@ pub struct Options { #[bpaf(external(output_type), optional)] output_type: Option, + #[bpaf(short('o'), argument("file"))] + /// Output path + output_path: Option, + #[bpaf(positional("filename"))] /// PTX file ptx_path: String, @@ -30,7 +34,10 @@ fn main() -> Result<(), CompilerError> { let ptx_path = Path::new(&opts.ptx_path).to_path_buf(); check_path(&ptx_path)?; - let output_path = get_output_path(&ptx_path, &output_type)?; + let output_path = match opts.output_path { + Some(value) => value, + None => get_output_path(&ptx_path, &output_type)? + }; check_path(&output_path)?; let ptx = fs::read(&ptx_path).map_err(CompilerError::from)?;