From 536ebe374b0e89a50b93fe08f35874a6f5b12970 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Mon, 19 May 2025 14:16:37 +0100 Subject: [PATCH] modify interface to add ProverResourceType --- crates/zkvm-interface/src/lib.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/zkvm-interface/src/lib.rs b/crates/zkvm-interface/src/lib.rs index 398e5ff..367d9fb 100644 --- a/crates/zkvm-interface/src/lib.rs +++ b/crates/zkvm-interface/src/lib.rs @@ -15,12 +15,20 @@ pub trait Compiler { fn compile(path_to_program: &Path) -> Result; } +/// ResourceType specifies what resource will be used to create the proofs. +#[derive(Debug, Copy, Clone, Default)] +pub enum ProverResourceType { + #[default] + Cpu, + Gpu, +} + #[allow(non_camel_case_types)] /// zkVM trait to abstract away the differences between each zkVM pub trait zkVM { type Error: std::error::Error + Send + Sync + 'static; - fn new(program_bytes: C::Program) -> Self; + fn new(program_bytes: C::Program, resource: ProverResourceType) -> Self; /// Executes the given program with the inputs accumulated in the Input struct. /// For RISCV programs, `program_bytes` will be the ELF binary