pub struct HostBytesBackend;Expand description
Minimal host-resident backend used as the default backend adapter for host-visible byte-slice views in generic helper code.
Trait Implementations§
Source§impl Backend for HostBytesBackend
impl Backend for HostBytesBackend
Source§type ScalarPrep = i64
type ScalarPrep = i64
Scalar type for DFT-domain (prepared) polynomial representations.
Source§fn alloc_bytes(len: usize) -> <HostBytesBackend as Backend>::OwnedBuf
fn alloc_bytes(len: usize) -> <HostBytesBackend as Backend>::OwnedBuf
Allocates a backend-owned byte buffer of
len bytes.Source§fn alloc_zeroed_bytes(len: usize) -> <HostBytesBackend as Backend>::OwnedBuf
fn alloc_zeroed_bytes(len: usize) -> <HostBytesBackend as Backend>::OwnedBuf
Allocates a zero-initialized backend-owned byte buffer of
len bytes. Read moreSource§fn from_host_bytes(bytes: &[u8]) -> <HostBytesBackend as Backend>::OwnedBuf
fn from_host_bytes(bytes: &[u8]) -> <HostBytesBackend as Backend>::OwnedBuf
Uploads or copies host bytes into backend-owned storage.
Source§fn from_bytes(bytes: Vec<u8>) -> <HostBytesBackend as Backend>::OwnedBuf
fn from_bytes(bytes: Vec<u8>) -> <HostBytesBackend as Backend>::OwnedBuf
Wraps/Uploads a host-owned byte buffer into backend-owned storage. Read more
Source§fn to_host_bytes(buf: &<HostBytesBackend as Backend>::OwnedBuf) -> Vec<u8> ⓘ
fn to_host_bytes(buf: &<HostBytesBackend as Backend>::OwnedBuf) -> Vec<u8> ⓘ
Copies the contents of a backend-owned buffer into a fresh host
Vec<u8>. Read moreSource§fn copy_to_host(buf: &<HostBytesBackend as Backend>::OwnedBuf, dst: &mut [u8])
fn copy_to_host(buf: &<HostBytesBackend as Backend>::OwnedBuf, dst: &mut [u8])
Copies the contents of a backend-owned buffer into a host byte slice. Read more
Source§fn copy_from_host(buf: &mut <HostBytesBackend as Backend>::OwnedBuf, src: &[u8])
fn copy_from_host(buf: &mut <HostBytesBackend as Backend>::OwnedBuf, src: &[u8])
Copies a host byte slice into a backend-owned buffer. Read more
Source§fn len_bytes(buf: &<HostBytesBackend as Backend>::OwnedBuf) -> usize
fn len_bytes(buf: &<HostBytesBackend as Backend>::OwnedBuf) -> usize
Returns the number of bytes stored in a backend-owned buffer.
Source§fn view(
buf: &<HostBytesBackend as Backend>::OwnedBuf,
) -> <HostBytesBackend as Backend>::BufRef<'_>
fn view( buf: &<HostBytesBackend as Backend>::OwnedBuf, ) -> <HostBytesBackend as Backend>::BufRef<'_>
Borrows a shared backend-native view over an owned buffer.
Source§fn view_ref<'a, 'b>(
buf: &'a <HostBytesBackend as Backend>::BufRef<'b>,
) -> <HostBytesBackend as Backend>::BufRef<'a>where
HostBytesBackend: 'b,
fn view_ref<'a, 'b>(
buf: &'a <HostBytesBackend as Backend>::BufRef<'b>,
) -> <HostBytesBackend as Backend>::BufRef<'a>where
HostBytesBackend: 'b,
Reborrows an existing shared backend-native view.
Source§fn view_ref_mut<'a, 'b>(
buf: &'a <HostBytesBackend as Backend>::BufMut<'b>,
) -> <HostBytesBackend as Backend>::BufRef<'a>where
HostBytesBackend: 'b,
fn view_ref_mut<'a, 'b>(
buf: &'a <HostBytesBackend as Backend>::BufMut<'b>,
) -> <HostBytesBackend as Backend>::BufRef<'a>where
HostBytesBackend: 'b,
Reborrows a mutable backend-native view as a shared backend-native view.
Source§fn view_mut_ref<'a, 'b>(
buf: &'a mut <HostBytesBackend as Backend>::BufMut<'b>,
) -> <HostBytesBackend as Backend>::BufMut<'a>where
HostBytesBackend: 'b,
fn view_mut_ref<'a, 'b>(
buf: &'a mut <HostBytesBackend as Backend>::BufMut<'b>,
) -> <HostBytesBackend as Backend>::BufMut<'a>where
HostBytesBackend: 'b,
Reborrows an existing mutable backend-native view.
Source§fn view_mut(
buf: &mut <HostBytesBackend as Backend>::OwnedBuf,
) -> <HostBytesBackend as Backend>::BufMut<'_>
fn view_mut( buf: &mut <HostBytesBackend as Backend>::OwnedBuf, ) -> <HostBytesBackend as Backend>::BufMut<'_>
Borrows a mutable backend-native view over an owned buffer.
Source§fn region(
buf: &<HostBytesBackend as Backend>::OwnedBuf,
offset: usize,
len: usize,
) -> <HostBytesBackend as Backend>::BufRef<'_>
fn region( buf: &<HostBytesBackend as Backend>::OwnedBuf, offset: usize, len: usize, ) -> <HostBytesBackend as Backend>::BufRef<'_>
Borrows a shared sub-region of an owned buffer.
Source§fn region_mut(
buf: &mut <HostBytesBackend as Backend>::OwnedBuf,
offset: usize,
len: usize,
) -> <HostBytesBackend as Backend>::BufMut<'_>
fn region_mut( buf: &mut <HostBytesBackend as Backend>::OwnedBuf, offset: usize, len: usize, ) -> <HostBytesBackend as Backend>::BufMut<'_>
Borrows a mutable sub-region of an owned buffer.
Source§fn region_ref<'a, 'b>(
buf: &'a <HostBytesBackend as Backend>::BufRef<'b>,
offset: usize,
len: usize,
) -> <HostBytesBackend as Backend>::BufRef<'a>where
HostBytesBackend: 'b,
fn region_ref<'a, 'b>(
buf: &'a <HostBytesBackend as Backend>::BufRef<'b>,
offset: usize,
len: usize,
) -> <HostBytesBackend as Backend>::BufRef<'a>where
HostBytesBackend: 'b,
Reborrows a shared sub-region of an existing shared backend-native view.
Source§fn region_ref_mut<'a, 'b>(
buf: &'a <HostBytesBackend as Backend>::BufMut<'b>,
offset: usize,
len: usize,
) -> <HostBytesBackend as Backend>::BufRef<'a>where
HostBytesBackend: 'b,
fn region_ref_mut<'a, 'b>(
buf: &'a <HostBytesBackend as Backend>::BufMut<'b>,
offset: usize,
len: usize,
) -> <HostBytesBackend as Backend>::BufRef<'a>where
HostBytesBackend: 'b,
Reborrows a shared sub-region of an existing mutable backend-native view.
Source§fn region_mut_ref<'a, 'b>(
buf: &'a mut <HostBytesBackend as Backend>::BufMut<'b>,
offset: usize,
len: usize,
) -> <HostBytesBackend as Backend>::BufMut<'a>where
HostBytesBackend: 'b,
fn region_mut_ref<'a, 'b>(
buf: &'a mut <HostBytesBackend as Backend>::BufMut<'b>,
offset: usize,
len: usize,
) -> <HostBytesBackend as Backend>::BufMut<'a>where
HostBytesBackend: 'b,
Reborrows a mutable sub-region of an existing mutable backend-native view.
Source§unsafe fn destroy(_handle: NonNull<<HostBytesBackend as Backend>::Handle>)
unsafe fn destroy(_handle: NonNull<<HostBytesBackend as Backend>::Handle>)
Deallocates a backend handle. Read more
Source§fn size_of_scalar_big() -> usize
fn size_of_scalar_big() -> usize
Bytes size of
ScalarBig.Source§fn size_of_scalar_prep() -> usize
fn size_of_scalar_prep() -> usize
Bytes size of
ScalarPrep.Source§const SCRATCH_ALIGN: usize = 64
const SCRATCH_ALIGN: usize = 64
Required alignment (in bytes) for scratch-arena carved regions. Read more
Source§fn bytes_of_vec_znx_dft(n: usize, cols: usize, size: usize) -> usize
fn bytes_of_vec_znx_dft(n: usize, cols: usize, size: usize) -> usize
Byte size of a
crate::layouts::VecZnxDft buffer.Source§fn bytes_of_vec_znx_big(n: usize, cols: usize, size: usize) -> usize
fn bytes_of_vec_znx_big(n: usize, cols: usize, size: usize) -> usize
Byte size of a
crate::layouts::VecZnxBig buffer.Source§fn bytes_of_svp_ppol(n: usize, cols: usize) -> usize
fn bytes_of_svp_ppol(n: usize, cols: usize) -> usize
Byte size of a
crate::layouts::SvpPPol buffer.Source§fn bytes_of_vmp_pmat(
n: usize,
rows: usize,
cols_in: usize,
cols_out: usize,
size: usize,
) -> usize
fn bytes_of_vmp_pmat( n: usize, rows: usize, cols_in: usize, cols_out: usize, size: usize, ) -> usize
Byte size of a
crate::layouts::VmpPMat buffer.Source§fn bytes_of_cnv_pvec_left(n: usize, cols: usize, size: usize) -> usize
fn bytes_of_cnv_pvec_left(n: usize, cols: usize, size: usize) -> usize
Byte size of a
crate::layouts::CnvPVecL buffer.Source§fn bytes_of_cnv_pvec_right(n: usize, cols: usize, size: usize) -> usize
fn bytes_of_cnv_pvec_right(n: usize, cols: usize, size: usize) -> usize
Byte size of a
crate::layouts::CnvPVecR buffer.Source§impl Clone for HostBytesBackend
impl Clone for HostBytesBackend
Source§fn clone(&self) -> HostBytesBackend
fn clone(&self) -> HostBytesBackend
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HostBytesBackend
impl Debug for HostBytesBackend
Source§impl Default for HostBytesBackend
impl Default for HostBytesBackend
Source§fn default() -> HostBytesBackend
fn default() -> HostBytesBackend
Returns the “default value” for a type. Read more
Source§impl PartialEq for HostBytesBackend
impl PartialEq for HostBytesBackend
Source§fn eq(&self, other: &HostBytesBackend) -> bool
fn eq(&self, other: &HostBytesBackend) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for HostBytesBackend
impl Eq for HostBytesBackend
impl StructuralPartialEq for HostBytesBackend
Auto Trait Implementations§
impl Freeze for HostBytesBackend
impl RefUnwindSafe for HostBytesBackend
impl Send for HostBytesBackend
impl Sync for HostBytesBackend
impl Unpin for HostBytesBackend
impl UnsafeUnpin for HostBytesBackend
impl UnwindSafe for HostBytesBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more