Skip to content

Commit

Permalink
chore(gpu): remove device synchronization in drop for CudaVec
Browse files Browse the repository at this point in the history
  • Loading branch information
agnesLeroy committed Aug 7, 2024
1 parent d69dd20 commit abc5ecf
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tfhe/src/core_crypto/gpu/vec.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::core_crypto::gpu::slice::{CudaSlice, CudaSliceMut};
use crate::core_crypto::gpu::{synchronize_device, CudaStreams};
use crate::core_crypto::gpu::CudaStreams;
use crate::core_crypto::prelude::Numeric;
use std::collections::Bound::{Excluded, Included, Unbounded};
use std::ffi::c_void;
Expand Down Expand Up @@ -447,8 +447,6 @@ impl<T: Numeric> Drop for CudaVec<T> {
/// Free memory for pointer `ptr` synchronously
fn drop(&mut self) {
for &gpu_index in self.gpu_indexes.iter() {
// Synchronizes the device to be sure no stream is still using this pointer
synchronize_device(gpu_index);
unsafe { cuda_drop(self.get_mut_c_ptr(gpu_index), gpu_index) };
}
}
Expand Down

0 comments on commit abc5ecf

Please sign in to comment.