Compare commits

...

1 Commits

Author SHA1 Message Date
Agnes Leroy
67f19bfd93 fix(gpu): fix clear shift computation in long run tests 2025-09-12 16:31:39 +02:00
4 changed files with 8 additions and 8 deletions

View File

@@ -41,10 +41,10 @@ where
let clear_mul = |x, y| x * y;
// Warning this rotate definition only works with 64-bit ciphertexts
let clear_rotate_left = |x: u64, y: u64| x.rotate_left(y as u32);
let clear_left_shift = |x, y| x << y;
let clear_left_shift = |x: u64, y: u64| x.overflowing_shl(y as u32).0;
// Warning this rotate definition only works with 64-bit ciphertexts
let clear_rotate_right = |x: u64, y: u64| x.rotate_right(y as u32);
let clear_right_shift = |x, y| x >> y;
let clear_right_shift = |x: u64, y: u64| x.overflowing_shr(y as u32).0;
let clear_max = |x: u64, y: u64| max(x, y);
let clear_min = |x: u64, y: u64| min(x, y);

View File

@@ -68,10 +68,10 @@ where
let right_shift_executor = GpuMultiDeviceFunctionExecutor::new(&CudaServerKey::right_shift);
// Warning this rotate definition only works with 64-bit ciphertexts
let clear_rotate_left = |x: i64, y: u64| x.rotate_left(y as u32);
let clear_left_shift = |x: i64, y: u64| x << y;
let clear_left_shift = |x: i64, y: u64| x.overflowing_shl(y as u32).0;
// Warning this rotate definition only works with 64-bit ciphertexts
let clear_rotate_right = |x: i64, y: u64| x.rotate_right(y as u32);
let clear_right_shift = |x: i64, y: u64| x >> y;
let clear_right_shift = |x: i64, y: u64| x.overflowing_shr(y as u32).0;
#[allow(clippy::type_complexity)]
let mut shift_rotate_ops: Vec<(
SignedShiftRotateExecutor,

View File

@@ -82,10 +82,10 @@ where
let clear_mul = |x: u64, y: u64| x.wrapping_mul(y);
// Warning this rotate definition only works with 64-bit ciphertexts
let clear_rotate_left = |x: u64, y: u64| x.rotate_left(y as u32);
let clear_left_shift = |x, y| x << y;
let clear_left_shift = |x: u64, y: u64| x.overflowing_shl(y as u32).0;
// Warning this rotate definition only works with 64-bit ciphertexts
let clear_rotate_right = |x: u64, y: u64| x.rotate_right(y as u32);
let clear_right_shift = |x, y| x >> y;
let clear_right_shift = |x: u64, y: u64| x.overflowing_shr(y as u32).0;
let clear_max = |x: u64, y: u64| max(x, y);
let clear_min = |x: u64, y: u64| min(x, y);

View File

@@ -135,10 +135,10 @@ where
let right_shift_executor = CpuFunctionExecutor::new(&ServerKey::right_shift_parallelized);
// Warning this rotate definition only works with 64-bit ciphertexts
let clear_rotate_left = |x: i64, y: u64| x.rotate_left(y as u32);
let clear_left_shift = |x: i64, y: u64| x << y;
let clear_left_shift = |x: i64, y: u64| x.overflowing_shl(y as u32).0;
// Warning this rotate definition only works with 64-bit ciphertexts
let clear_rotate_right = |x: i64, y: u64| x.rotate_right(y as u32);
let clear_right_shift = |x: i64, y: u64| x >> y;
let clear_right_shift = |x: i64, y: u64| x.overflowing_shr(y as u32).0;
#[allow(clippy::type_complexity)]
let mut rotate_shift_ops: Vec<(
SignedShiftRotateExecutor,