Skip to main content

ab_proof_of_space_gpu/
lib.rs

1//! Proof of space plotting utilities for GPU (Vulkan/Metal).
2//!
3//! Similarly to `ab-proof-of-space`, max supported `K` within range `15..=24` due to internal data
4//! structures used (`ab-proof-of-space` also supports `K=25`, but this crate doesn't for now).
5
6#![cfg_attr(target_arch = "spirv", no_std)]
7#![feature(generic_const_exprs, step_trait)]
8#![expect(incomplete_features, reason = "generic_const_exprs")]
9
10#[cfg(not(target_arch = "spirv"))]
11mod host;
12// This is used for benchmarks of isolated shaders externally, not for general use
13#[doc(hidden)]
14pub mod shader;
15
16// TODO: Remove gate after https://github.com/Rust-GPU/rust-gpu/pull/249
17#[cfg(not(target_arch = "spirv"))]
18pub use crate::shader::find_proofs::ProofsHost;
19#[cfg(not(target_arch = "spirv"))]
20pub use host::{Device, GpuRecordsEncoderInstance, ProofsHostWrapper, RecordEncodingError};
21#[cfg(not(target_arch = "spirv"))]
22use subspace_core_primitives::pos::PosProof;
23#[cfg(not(target_arch = "spirv"))]
24pub use wgpu::{Backend, DeviceType};
25
26// TODO: Remove gate after https://github.com/Rust-GPU/rust-gpu/pull/249
27#[cfg(not(target_arch = "spirv"))]
28const _: () = {
29    assert!(PosProof::K >= 15 && PosProof::K <= 24);
30};