Skip to content
Snippets Groups Projects
Commit 937e9b7f authored by rarbore2's avatar rarbore2
Browse files

make imm refs copy

parent c5063c59
No related branches found
No related tags found
1 merge request!198Optimization for miranda
Pipeline #201832 passed
...@@ -150,7 +150,7 @@ extern "C" { ...@@ -150,7 +150,7 @@ extern "C" {
fn ___cublas_sgemm(i: u64, j: u64, k: u64, c: *mut u8, a: *const u8, b: *const u8); fn ___cublas_sgemm(i: u64, j: u64, k: u64, c: *mut u8, a: *const u8, b: *const u8);
} }
#[derive(Clone, Debug)] #[derive(Clone, Debug, Copy)]
pub struct HerculesCPURef<'a> { pub struct HerculesCPURef<'a> {
ptr: NonNull<u8>, ptr: NonNull<u8>,
size: usize, size: usize,
...@@ -165,7 +165,7 @@ pub struct HerculesCPURefMut<'a> { ...@@ -165,7 +165,7 @@ pub struct HerculesCPURefMut<'a> {
} }
#[cfg(feature = "cuda")] #[cfg(feature = "cuda")]
#[derive(Clone, Debug)] #[derive(Clone, Debug, Copy)]
pub struct HerculesCUDARef<'a> { pub struct HerculesCUDARef<'a> {
ptr: NonNull<u8>, ptr: NonNull<u8>,
size: usize, size: usize,
......
...@@ -25,6 +25,12 @@ fn cava_bench(c: &mut Criterion) { ...@@ -25,6 +25,12 @@ fn cava_bench(c: &mut Criterion) {
let (rows, cols, num_ctrl_pts, image, tstw, ctrl_pts, weights, coefs, tonemap) = let (rows, cols, num_ctrl_pts, image, tstw, ctrl_pts, weights, coefs, tonemap) =
prepare_hercules_inputs(&raw_image, &cam_model); prepare_hercules_inputs(&raw_image, &cam_model);
let mut r = runner!(cava); let mut r = runner!(cava);
let image = image.to();
let tstw = tstw.to();
let ctrl_pts = ctrl_pts.to();
let weights = weights.to();
let coefs = coefs.to();
let tonemap = tonemap.to();
group.bench_function("cava bench small", |b| { group.bench_function("cava bench small", |b| {
b.iter(|| { b.iter(|| {
...@@ -32,12 +38,12 @@ fn cava_bench(c: &mut Criterion) { ...@@ -32,12 +38,12 @@ fn cava_bench(c: &mut Criterion) {
rows as u64, rows as u64,
cols as u64, cols as u64,
num_ctrl_pts as u64, num_ctrl_pts as u64,
image.to(), image,
tstw.to(), tstw,
ctrl_pts.to(), ctrl_pts,
weights.to(), weights,
coefs.to(), coefs,
tonemap.to(), tonemap,
)); ));
}) })
}); });
...@@ -55,6 +61,12 @@ fn cava_bench(c: &mut Criterion) { ...@@ -55,6 +61,12 @@ fn cava_bench(c: &mut Criterion) {
let (rows, cols, num_ctrl_pts, image, tstw, ctrl_pts, weights, coefs, tonemap) = let (rows, cols, num_ctrl_pts, image, tstw, ctrl_pts, weights, coefs, tonemap) =
prepare_hercules_inputs(&raw_image, &cam_model); prepare_hercules_inputs(&raw_image, &cam_model);
let mut r = runner!(cava); let mut r = runner!(cava);
let image = image.to();
let tstw = tstw.to();
let ctrl_pts = ctrl_pts.to();
let weights = weights.to();
let coefs = coefs.to();
let tonemap = tonemap.to();
group.bench_function("cava bench full", |b| { group.bench_function("cava bench full", |b| {
b.iter(|| { b.iter(|| {
...@@ -62,12 +74,12 @@ fn cava_bench(c: &mut Criterion) { ...@@ -62,12 +74,12 @@ fn cava_bench(c: &mut Criterion) {
rows as u64, rows as u64,
cols as u64, cols as u64,
num_ctrl_pts as u64, num_ctrl_pts as u64,
image.to(), image,
tstw.to(), tstw,
ctrl_pts.to(), ctrl_pts,
weights.to(), weights,
coefs.to(), coefs,
tonemap.to(), tonemap,
)); ));
}) })
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment