Skip to main content

GpuDevice

Struct GpuDevice 

Source
pub struct GpuDevice {
    pub config: GpuDeviceConfig,
    pub device_ctx: GpuDeviceCtx,
}
Expand description

Stream-owning device handle. Wraps GpuDeviceConfig with a GpuDeviceCtx that carries the explicit CUDA stream.

Fields§

§config: GpuDeviceConfig§device_ctx: GpuDeviceCtx

Implementations§

Source§

impl GpuDevice

Source

pub fn new(params: SystemParams) -> Result<Self, CudaError>

Source

pub fn params(&self) -> &SystemParams

Source

pub fn prover_config(&self) -> &GpuProverConfig

Source

pub fn prover_config_mut(&mut self) -> &mut GpuProverConfig

Source

pub fn sm_count(&self) -> u32

Source

pub fn id(&self) -> u32

Source

pub fn with_cache_rs_code_matrix(self, cache_rs_code_matrix: bool) -> Self

Source

pub fn set_cache_rs_code_matrix(&mut self, cache_rs_code_matrix: bool)

Trait Implementations§

Source§

impl Clone for GpuDevice

Source§

fn clone(&self) -> GpuDevice

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<HS: GpuHashScheme> DeviceDataTransporter<<HS as GpuHashScheme>::SC, GenericGpuBackend<HS>> for GpuDevice

Source§

fn transport_pk_to_device( &self, mpk: &MultiStarkProvingKey<HS::SC>, ) -> DeviceMultiStarkProvingKey<GenericGpuBackend<HS>>

Transport the proving key to the device, filtering for only the provided air_ids.
Source§

fn transport_matrix_to_device( &self, matrix: &ColMajorMatrix<F>, ) -> DeviceMatrix<F>

Source§

fn transport_pcs_data_to_device( &self, pcs_data: &StackedPcsData<F, HS::Digest>, ) -> StackedPcsDataGpu<F, HS::Digest>

The commitment and prover_data are assumed to have been previously computed from the trace.
Source§

fn transport_matrix_from_device_to_host( &self, matrix: &DeviceMatrix<F>, ) -> ColMajorMatrix<F>

Transport a device matrix to host. This should only be used for testing / debugging purposes.
Source§

fn transport_committed_trace_data_to_device( &self, committed_trace: &CommittedTraceData<CpuColMajorBackend<SC>>, ) -> CommittedTraceData<PB>

Source§

fn transport_proving_ctx_to_device( &self, ctx: &ProvingContext<CpuColMajorBackend<SC>>, ) -> ProvingContext<PB>

Source§

impl<HS: GpuHashScheme, TS: GpuFiatShamirTranscript<HS::SC>> MultiRapProver<GenericGpuBackend<HS>, TS> for GpuDevice

Source§

type Artifacts = Vec<BinomialExtensionField<MontyField31<BabyBearParameters>, 4>>

The random opening point r where the batch constraint sumcheck reduces to evaluation claims of trace matrices T, T_{rot} at r_{n_T}.

Source§

type PartialProof = (GkrProof<<HS as GpuHashScheme>::SC>, BatchConstraintProof<<HS as GpuHashScheme>::SC>)

The partial proof is the proof that the trace matrices satisfy all constraints assuming that certain polynomial opening claims are validated. In other words, it is a proof that reduces the constraint satisfaction claim to certain polynomial opening claims.
Source§

type Error = ProverError

Source§

fn prove_rap_constraints( &self, transcript: &mut TS, mpk: &DeviceMultiStarkProvingKey<GenericGpuBackend<HS>>, ctx: &ProvingContext<GenericGpuBackend<HS>>, _common_main_pcs_data: &StackedPcsDataGpu<F, HS::Digest>, ) -> Result<((GkrProof<HS::SC>, BatchConstraintProof<HS::SC>), Vec<EF>), Self::Error>

Source§

impl<HS: GpuHashScheme, TS: GpuFiatShamirTranscript<HS::SC>> OpeningProver<GenericGpuBackend<HS>, TS> for GpuDevice

Source§

type OpeningPoints = Vec<BinomialExtensionField<MontyField31<BabyBearParameters>, 4>>

The shared vector r where each trace matrix T, T_{rot} is opened at r_{n_T}.

Source§

type OpeningProof = (StackingProof<<HS as GpuHashScheme>::SC>, WhirProof<<HS as GpuHashScheme>::SC>)

PCS opening proof on host. This should not be a reference.
Source§

type Error = ProverError

Computes the opening proof. The common_main_pcs_data is the PcsData for the collection of common main trace matrices. It is owned by the function and may be mutated. The pre_cached_pcs_data_per_commit is the PcsData for the preprocessed and cached trace matrices. These are specified by their PcsData per commitment.
Source§

fn prove_openings( &self, transcript: &mut TS, mpk: &DeviceMultiStarkProvingKey<GenericGpuBackend<HS>>, ctx: ProvingContext<GenericGpuBackend<HS>>, common_main_pcs_data: StackedPcsDataGpu<F, HS::Digest>, r: Vec<EF>, ) -> Result<Self::OpeningProof, Self::Error>

Source§

impl<HS: GpuHashScheme, TS: GpuFiatShamirTranscript<HS::SC>> ProverDevice<GenericGpuBackend<HS>, TS> for GpuDevice

Source§

type Error = ProverError

Source§

type DeviceCtx = GpuDeviceCtx

Device-specific context (e.g., CUDA stream). Unit () for CPU devices.
Source§

fn device_ctx(&self) -> &GpuDeviceCtx

Source§

impl<HS: GpuHashScheme> TraceCommitter<GenericGpuBackend<HS>> for GpuDevice

Source§

type Error = ProverError

Source§

fn commit( &self, traces: &[&DeviceMatrix<F>], ) -> Result<(HS::Digest, StackedPcsDataGpu<F, HS::Digest>), Self::Error>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more