Skip to content
Snippets Groups Projects
Commit 298d0806 authored by Hadrien Grasland's avatar Hadrien Grasland
Browse files

Slightly less wasteful data copy

parent 63ae06c1
No related branches found
No related tags found
No related merge requests found
......@@ -829,9 +829,11 @@ impl Concentrations {
// Access the CPU-side buffer
let v_data = self.v_buffer.read()?;
for (buf, elem) in v_data.iter().zip(self.v_ndarray.iter_mut()) {
*elem = *buf;
}
let v_target = self
.v_ndarray
.as_slice_mut()
.expect("Failed to access ndarray as slice");
v_target.copy_from_slice(&v_data);
Ok(&self.v_ndarray)
}
......
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