From cb4263605eb0e00e89a04f8f2fd2cfb3059af96a Mon Sep 17 00:00:00 2001 From: tmontaigu Date: Wed, 14 Feb 2024 11:11:14 +0100 Subject: [PATCH] fix(hlapi): bind missing cuda bitnot --- tfhe/src/high_level_api/booleans/base.rs | 2 +- tfhe/src/high_level_api/integers/unsigned/ops.rs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tfhe/src/high_level_api/booleans/base.rs b/tfhe/src/high_level_api/booleans/base.rs index 9c0dbc4320..eb7b5d5784 100644 --- a/tfhe/src/high_level_api/booleans/base.rs +++ b/tfhe/src/high_level_api/booleans/base.rs @@ -1246,7 +1246,7 @@ impl std::ops::Not for &FheBool { } #[cfg(feature = "gpu")] InternalServerKey::Cuda(cuda_key) => with_thread_local_cuda_stream(|stream| { - let inner = cuda_key + let mut inner = cuda_key .key .scalar_bitxor(&self.ciphertext.on_gpu(), 1, stream); inner.info.blocks[0].degree = crate::shortint::ciphertext::Degree::new(1); diff --git a/tfhe/src/high_level_api/integers/unsigned/ops.rs b/tfhe/src/high_level_api/integers/unsigned/ops.rs index 748f17a869..ff310cd822 100644 --- a/tfhe/src/high_level_api/integers/unsigned/ops.rs +++ b/tfhe/src/high_level_api/integers/unsigned/ops.rs @@ -1979,9 +1979,10 @@ where FheUint::new(ciphertext) } #[cfg(feature = "gpu")] - InternalServerKey::Cuda(_) => { - panic!("Not '!' is not yet supported by Cuda devices") - } + InternalServerKey::Cuda(cuda_key) => with_thread_local_cuda_stream(|stream| { + let inner_result = cuda_key.key.bitnot(&self.ciphertext.on_gpu(), stream); + FheUint::new(inner_result) + }), }) } }