mirror of
https://github.com/arnaucube/poulpy.git
synced 2026-02-10 13:16:44 +01:00
Ref. + AVX code & generic tests + benches (#85)
This commit is contained in:
committed by
GitHub
parent
99b9e3e10e
commit
56dbd29c59
@@ -1,4 +1,6 @@
|
||||
use crate::layouts::{Backend, ScalarZnxToRef, SvpPPolOwned, SvpPPolToMut, SvpPPolToRef, VecZnxDftToMut, VecZnxDftToRef};
|
||||
use crate::layouts::{
|
||||
Backend, ScalarZnxToRef, SvpPPolOwned, SvpPPolToMut, SvpPPolToRef, VecZnxDftToMut, VecZnxDftToRef, VecZnxToRef,
|
||||
};
|
||||
|
||||
/// Allocates as [crate::layouts::SvpPPol].
|
||||
pub trait SvpPPolAlloc<B: Backend> {
|
||||
@@ -25,8 +27,26 @@ pub trait SvpPrepare<B: Backend> {
|
||||
}
|
||||
|
||||
/// Apply a scalar-vector product between `a[a_col]` and `b[b_col]` and stores the result on `res[res_col]`.
|
||||
pub trait SvpApply<B: Backend> {
|
||||
fn svp_apply<R, A, C>(&self, res: &mut R, res_col: usize, a: &A, a_col: usize, b: &C, b_col: usize)
|
||||
pub trait SvpApplyDft<B: Backend> {
|
||||
fn svp_apply_dft<R, A, C>(&self, res: &mut R, res_col: usize, a: &A, a_col: usize, b: &C, b_col: usize)
|
||||
where
|
||||
R: VecZnxDftToMut<B>,
|
||||
A: SvpPPolToRef<B>,
|
||||
C: VecZnxToRef;
|
||||
}
|
||||
|
||||
/// Apply a scalar-vector product between `a[a_col]` and `b[b_col]` and stores the result on `res[res_col]`.
|
||||
pub trait SvpApplyDftToDft<B: Backend> {
|
||||
fn svp_apply_dft_to_dft<R, A, C>(&self, res: &mut R, res_col: usize, a: &A, a_col: usize, b: &C, b_col: usize)
|
||||
where
|
||||
R: VecZnxDftToMut<B>,
|
||||
A: SvpPPolToRef<B>,
|
||||
C: VecZnxDftToRef<B>;
|
||||
}
|
||||
|
||||
/// Apply a scalar-vector product between `a[a_col]` and `b[b_col]` and adds the result on `res[res_col]`.
|
||||
pub trait SvpApplyDftToDftAdd<B: Backend> {
|
||||
fn svp_apply_dft_to_dft_add<R, A, C>(&self, res: &mut R, res_col: usize, a: &A, a_col: usize, b: &C, b_col: usize)
|
||||
where
|
||||
R: VecZnxDftToMut<B>,
|
||||
A: SvpPPolToRef<B>,
|
||||
@@ -34,8 +54,8 @@ pub trait SvpApply<B: Backend> {
|
||||
}
|
||||
|
||||
/// Apply a scalar-vector product between `res[res_col]` and `a[a_col]` and stores the result on `res[res_col]`.
|
||||
pub trait SvpApplyInplace<B: Backend> {
|
||||
fn svp_apply_inplace<R, A>(&self, res: &mut R, res_col: usize, a: &A, a_col: usize)
|
||||
pub trait SvpApplyDftToDftInplace<B: Backend> {
|
||||
fn svp_apply_dft_to_dft_inplace<R, A>(&self, res: &mut R, res_col: usize, a: &A, a_col: usize)
|
||||
where
|
||||
R: VecZnxDftToMut<B>,
|
||||
A: SvpPPolToRef<B>;
|
||||
|
||||
Reference in New Issue
Block a user