aboutsummaryrefslogtreecommitdiffhomepage
path: root/zluda_dump
diff options
context:
space:
mode:
authorAndrzej Janik <[email protected]>2021-05-07 18:22:09 +0200
committerAndrzej Janik <[email protected]>2021-05-07 18:22:09 +0200
commit425edfcdd49a4fa49d480f1b078c55dba4709e29 (patch)
treeb4c558356c5c8bc3341f90c3f2a4c56dad1876ab /zluda_dump
parent7f051ad20ec933f78ce4539020a25fab3503011c (diff)
downloadZLUDA-425edfcdd49a4fa49d480f1b078c55dba4709e29.tar.gz
ZLUDA-425edfcdd49a4fa49d480f1b078c55dba4709e29.zip
Simplify typing
Diffstat (limited to 'zluda_dump')
-rw-r--r--zluda_dump/src/lib.rs14
1 files changed, 11 insertions, 3 deletions
diff --git a/zluda_dump/src/lib.rs b/zluda_dump/src/lib.rs
index 4ea449c..f168930 100644
--- a/zluda_dump/src/lib.rs
+++ b/zluda_dump/src/lib.rs
@@ -191,7 +191,10 @@ 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() - 1));
+ 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(())
@@ -217,10 +220,15 @@ unsafe fn to_str<T>(image: *const T) -> Option<&'static str> {
fn directive_to_kernel(dir: &ast::Directive<ast::ParsedArgParams>) -> Option<(String, Vec<usize>)> {
match dir {
ast::Directive::Method(ast::Function {
- func_directive: ast::MethodDecl::Kernel { name, in_args },
+ func_directive:
+ ast::MethodDeclaration {
+ name: ast::MethodName::Kernel(name),
+ input_arguments,
+ ..
+ },
..
}) => {
- let arg_sizes = in_args
+ let arg_sizes = input_arguments
.iter()
.map(|arg| ast::Type::from(arg.v_type.clone()).size_of())
.collect();