Struct subspace_proof_of_space_gpu::cuda::CudaDevice
source · pub struct CudaDevice { /* private fields */ }
Expand description
Wrapper data structure encapsulating a single CUDA-capable device
Implementations§
source§impl CudaDevice
impl CudaDevice
sourcepub fn generate_and_encode_pospace(
&self,
seed: &PosSeed,
record: &mut Record,
encoded_chunks_used_output: impl ExactSizeIterator<Item = impl DerefMut<Target = bool>>,
) -> Result<(), String>
pub fn generate_and_encode_pospace( &self, seed: &PosSeed, record: &mut Record, encoded_chunks_used_output: impl ExactSizeIterator<Item = impl DerefMut<Target = bool>>, ) -> Result<(), String>
Generates and encodes PoSpace on the GPU.
This function performs the generation and encoding of PoSpace
on a GPU. It uses the specified parameters to perform the computations and
ensures that errors are properly handled by returning a Result
type.
§Parameters
§Input
k
: The size parameter for the table.seed
: A 32-byte seed used for the table generation process.record
: A slice of bytes (&[u8]
). These records are the data on which the proof of space will be generated.gpu_id
: ID of the GPU to use. This parameter specifies which GPU to use for the computation.
§Output
source_record_chunks
: A mutable vector of original data chunks of type FsFr, each 32 bytes in size.parity_record_chunks
: A mutable vector of parity chunks derived from the source, each 32 bytes in size.proof_count
: A mutable reference to the proof count. This value will be updated with the number of proofs generated.chunks_scratch
: A mutable vector used to store the processed chunks. This vector holds the final results after combining record chunks and proof hashes.challenge_index
: A mutable vector used to map the challenges to specific parts of the data.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CudaDevice
impl RefUnwindSafe for CudaDevice
impl Send for CudaDevice
impl Sync for CudaDevice
impl Unpin for CudaDevice
impl UnwindSafe for CudaDevice
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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