Reformat imports to a consistent style for imports
rustfmt.toml configuration: imports_granularity = "One" group_imports = "One"
This commit is contained in:
@@ -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>());
|
||||
|
Reference in New Issue
Block a user