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
@@ -20,7 +20,30 @@ pub struct Module<B: Backend> {
|
||||
_marker: PhantomData<B>,
|
||||
}
|
||||
|
||||
unsafe impl<B: Backend> Sync for Module<B> {}
|
||||
unsafe impl<B: Backend> Send for Module<B> {}
|
||||
|
||||
impl<B: Backend> Module<B> {
|
||||
#[allow(clippy::missing_safety_doc)]
|
||||
#[inline]
|
||||
pub fn new_marker(n: u64) -> Self {
|
||||
Self {
|
||||
ptr: NonNull::dangling(),
|
||||
n,
|
||||
_marker: PhantomData,
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::missing_safety_doc)]
|
||||
#[inline]
|
||||
pub unsafe fn from_nonnull(ptr: NonNull<B::Handle>, n: u64) -> Self {
|
||||
Self {
|
||||
ptr,
|
||||
n,
|
||||
_marker: PhantomData,
|
||||
}
|
||||
}
|
||||
|
||||
/// Construct from a raw pointer managed elsewhere.
|
||||
/// SAFETY: `ptr` must be non-null and remain valid for the lifetime of this Module.
|
||||
#[inline]
|
||||
|
||||
Reference in New Issue
Block a user