-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//! # CPU Prover Builder | ||
//! | ||
//! This module provides a builder for the [CpuProver]. | ||
use super::CpuProver; | ||
|
||
/// A builder for the [CpuProver]. | ||
/// | ||
/// The builder is used to configure the [CpuProver] before it is built. | ||
pub struct CpuProverBuilder { | ||
pub(crate) mock: bool, | ||
} | ||
|
||
impl CpuProverBuilder { | ||
/// Builds a [CpuProver]. | ||
/// | ||
/// # Details | ||
/// This method will build a [CpuProver] with the given parameters. In particular, it will | ||
/// build a mock prover if the `mock` flag is set. | ||
/// | ||
/// # Example | ||
/// ```rust,no_run | ||
/// let prover = ProverClient::builder().mock().build(); | ||
/// ``` | ||
pub fn build(self) -> CpuProver { | ||
if self.mock { CpuProver::mock() } else { CpuProver::new() } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//! # CPU Prover Builder | ||
//! | ||
//! This module provides a builder for the [CpuProver]. | ||
use sp1_prover::SP1Prover; | ||
|
||
use super::CudaProver; | ||
|
||
/// A builder for the [CudaProver]. | ||
/// | ||
/// The builder is used to configure the [CudaProver] before it is built. | ||
pub struct CudaProverBuilder; | ||
|
||
impl CudaProverBuilder { | ||
/// Builds a [CudaProver]. | ||
/// | ||
/// # Details | ||
/// This method will build a [CudaProver] with the given parameters. In particular, it will | ||
/// build a mock prover if the `mock` flag is set. | ||
/// | ||
/// # Example | ||
/// ```rust,no_run | ||
/// let prover = ProverClient::builder().cuda().build(); | ||
/// ``` | ||
pub fn build(self) -> CudaProver { | ||
CudaProver::new(SP1Prover::new()) | ||
} | ||
} |