From a6a609bcde1f0d79272d82eb85c74f3ab629d6f1 Mon Sep 17 00:00:00 2001 From: Agnes Leroy Date: Wed, 7 Aug 2024 17:20:21 +0200 Subject: [PATCH] chore(gpu): remove device synchronization in drop for CudaVec --- tfhe/src/core_crypto/gpu/vec.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tfhe/src/core_crypto/gpu/vec.rs b/tfhe/src/core_crypto/gpu/vec.rs index b18b791b3d..fc0e5d9d76 100644 --- a/tfhe/src/core_crypto/gpu/vec.rs +++ b/tfhe/src/core_crypto/gpu/vec.rs @@ -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; @@ -447,8 +447,6 @@ impl Drop for CudaVec { /// 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) }; } }