Don't use pinned memory when unnecessary (#17832)
Reports of excessive GPU memory usage and errors from cudaHostRegister. There are some cases where pinning is not required.
This commit is contained in:
@@ -146,6 +146,10 @@ impl<'a, T: Clone + Send + Sync + Default + Sized> IntoParallelIterator for &'a
|
||||
}
|
||||
|
||||
impl<T: Clone + Default + Sized> PinnedVec<T> {
|
||||
pub fn reserve(&mut self, size: usize) {
|
||||
self.x.reserve(size);
|
||||
}
|
||||
|
||||
pub fn reserve_and_pin(&mut self, size: usize) {
|
||||
if self.x.capacity() < size {
|
||||
if self.pinned {
|
||||
|
||||
Reference in New Issue
Block a user