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, uint_bit_width)]
8#![cfg_attr(not(target_arch = "spirv"), feature(iter_array_chunks, portable_simd))]
9#![expect(incomplete_features, reason = "generic_const_exprs")]
10#![cfg_attr(all(test, not(target_arch = "spirv")), feature(maybe_uninit_fill))]
11
12#[cfg(not(target_arch = "spirv"))]
13mod host;
14// This is used for benchmarks of isolated shaders externally, not for general use
15#[doc(hidden)]
16pub mod shader;
17
18// TODO: Remove gate after https://github.com/Rust-GPU/rust-gpu/pull/249
19#[cfg(not(target_arch = "spirv"))]
20use ab_core_primitives::pos::PosProof;
21#[cfg(not(target_arch = "spirv"))]
22pub use host::{Device, GpuRecordsEncoder};
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};