mirror of
https://github.com/vosen/ZLUDA.git
synced 2025-07-16 14:11:28 +00:00
zoc: Specify output path
This commit is contained in:
parent
1ce4a40b0f
commit
e6e9a79fe7
3 changed files with 11 additions and 4 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -104,9 +104,9 @@ checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bpaf"
|
name = "bpaf"
|
||||||
version = "0.9.18"
|
version = "0.9.19"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4de4d74c5891642753c67ab88f58d971a68dd98673b69689a8c24ce3ec78a412"
|
checksum = "4848ed5727d39a7573551c205bcb1ccd88c8cad4ed2c80f62e2316f208196b8d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bpaf_derive",
|
"bpaf_derive",
|
||||||
]
|
]
|
||||||
|
|
|
@ -11,7 +11,7 @@ path = "src/main.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
amd_comgr-sys = { path = "../ext/amd_comgr-sys" }
|
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" }
|
comgr = { path = "../comgr" }
|
||||||
hip_runtime-sys = { path = "../ext/hip_runtime-sys" }
|
hip_runtime-sys = { path = "../ext/hip_runtime-sys" }
|
||||||
ptx = { path = "../ptx" }
|
ptx = { path = "../ptx" }
|
||||||
|
|
|
@ -17,6 +17,10 @@ pub struct Options {
|
||||||
#[bpaf(external(output_type), optional)]
|
#[bpaf(external(output_type), optional)]
|
||||||
output_type: Option<OutputType>,
|
output_type: Option<OutputType>,
|
||||||
|
|
||||||
|
#[bpaf(short('o'), argument("file"))]
|
||||||
|
/// Output path
|
||||||
|
output_path: Option<PathBuf>,
|
||||||
|
|
||||||
#[bpaf(positional("filename"))]
|
#[bpaf(positional("filename"))]
|
||||||
/// PTX file
|
/// PTX file
|
||||||
ptx_path: String,
|
ptx_path: String,
|
||||||
|
@ -30,7 +34,10 @@ fn main() -> Result<(), CompilerError> {
|
||||||
let ptx_path = Path::new(&opts.ptx_path).to_path_buf();
|
let ptx_path = Path::new(&opts.ptx_path).to_path_buf();
|
||||||
check_path(&ptx_path)?;
|
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)?;
|
check_path(&output_path)?;
|
||||||
|
|
||||||
let ptx = fs::read(&ptx_path).map_err(CompilerError::from)?;
|
let ptx = fs::read(&ptx_path).map_err(CompilerError::from)?;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue