pub mod lints;
pub mod metrics;
pub mod parse;
pub mod ptxas;
pub mod report;
use lints::Thresholds;
use metrics::Options;
use report::{FileReport, KernelReport};
pub fn analyse_source(path: &str, src: &str, opts: &Options, t: &Thresholds) -> FileReport {
let module = parse::parse(src);
let kernels = module
.kernels
.into_iter()
.map(|k| {
let m = metrics::analyse(
&k,
module.target.as_deref(),
module.global_shared_bytes,
opts,
);
let occ = metrics::occupancy(&m);
let findings = lints::run(&k, &m, &occ, t);
KernelReport {
kernel: k,
metrics: m,
occupancy: occ,
findings,
}
})
.collect();
FileReport {
path: path.to_string(),
target: module.target,
kernels,
}
}