Update to custom fheuint prepare

This commit is contained in:
Pro7ech
2025-11-07 08:49:32 +01:00
parent 5cf184d950
commit 1d23dfc078
10 changed files with 112 additions and 34 deletions

View File

@@ -1,5 +1,5 @@
use poulpy_hal::{
api::{VmpPMatAlloc, VmpPMatBytesOf, VmpPrepare, VmpPrepareTmpBytes},
api::{VmpPMatAlloc, VmpPMatBytesOf, VmpPrepare, VmpPrepareTmpBytes, VmpZero},
layouts::{Backend, Data, DataMut, DataRef, Module, Scratch, VmpPMat, VmpPMatToMut, VmpPMatToRef, ZnxInfos},
};
@@ -51,7 +51,7 @@ impl<D: Data, B: Backend> GGSWInfos for GGSWPrepared<D, B> {
pub trait GGSWPreparedFactory<B: Backend>
where
Self: GetDegree + VmpPMatAlloc<B> + VmpPMatBytesOf + VmpPrepareTmpBytes + VmpPrepare<B>,
Self: GetDegree + VmpPMatAlloc<B> + VmpPMatBytesOf + VmpPrepareTmpBytes + VmpPrepare<B> + VmpZero<B>,
{
fn alloc_ggsw_prepared(
&self,
@@ -163,7 +163,7 @@ where
}
impl<B: Backend> GGSWPreparedFactory<B> for Module<B> where
Self: GetDegree + VmpPMatAlloc<B> + VmpPMatBytesOf + VmpPrepareTmpBytes + VmpPrepare<B>
Self: GetDegree + VmpPMatAlloc<B> + VmpPMatBytesOf + VmpPrepareTmpBytes + VmpPrepare<B> + VmpZero<B>
{
}
@@ -223,6 +223,13 @@ impl<D: DataMut, B: Backend> GGSWPrepared<D, B> {
{
module.ggsw_prepare(self, other, scratch);
}
pub fn zero<M>(&mut self, module: &M)
where
M: GGSWPreparedFactory<B>,
{
module.vmp_zero(&mut self.data);
}
}
pub trait GGSWPreparedToMut<B: Backend> {

View File

@@ -155,11 +155,7 @@ where
)
}
fn take_ggsw_slice<A>(
&mut self,
size: usize,
infos: &A,
) -> (Vec<GGSW<&mut [u8]>>, &mut Self)
fn take_ggsw_slice<A>(&mut self, size: usize, infos: &A) -> (Vec<GGSW<&mut [u8]>>, &mut Self)
where
A: GGSWInfos,
{