Reformat imports to a consistent style for imports

rustfmt.toml configuration:
  imports_granularity = "One"
  group_imports = "One"
This commit is contained in:
Michael Vines
2021-12-03 09:00:31 -08:00
parent 0ef1b25e4b
commit b8837c04ec
397 changed files with 5990 additions and 5175 deletions

View File

@@ -5,23 +5,26 @@
// copies from host memory to GPU memory unless the memory is page-pinned and
// cannot be paged to disk. The cuda driver provides these interfaces to pin and unpin memory.
use crate::perf_libs;
use crate::recycler::{RecyclerX, Reset};
use rand::seq::SliceRandom;
use rand::Rng;
use rayon::prelude::*;
use std::ops::{Index, IndexMut};
use std::slice::{Iter, IterMut, SliceIndex};
use std::sync::Weak;
use std::os::raw::c_int;
use {
crate::{
perf_libs,
recycler::{RecyclerX, Reset},
},
rand::{seq::SliceRandom, Rng},
rayon::prelude::*,
std::{
ops::{Index, IndexMut},
os::raw::c_int,
slice::{Iter, IterMut, SliceIndex},
sync::Weak,
},
};
const CUDA_SUCCESS: c_int = 0;
fn pin<T>(_mem: &mut Vec<T>) {
if let Some(api) = perf_libs::api() {
use std::ffi::c_void;
use std::mem::size_of;
use std::{ffi::c_void, mem::size_of};
let ptr = _mem.as_mut_ptr();
let size = _mem.capacity().saturating_mul(size_of::<T>());