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(target_arch = "spirv", feature(bigint_helper_methods))]
9#![cfg_attr(not(target_arch = "spirv"), feature(iter_array_chunks, portable_simd))]
10#![expect(incomplete_features, reason = "generic_const_exprs")]
11#![cfg_attr(
12    all(test, not(target_arch = "spirv")),
13    feature(const_convert, const_trait_impl, maybe_uninit_fill)
14)]
15
16#[cfg(not(target_arch = "spirv"))]
17mod host;
18// This is used for benchmarks of isolated shaders externally, not for general use
19#[doc(hidden)]
20pub mod shader;
21
22// TODO: Remove gate after https://github.com/Rust-GPU/rust-gpu/pull/249
23#[cfg(not(target_arch = "spirv"))]
24use ab_core_primitives::pos::PosProof;
25#[cfg(not(target_arch = "spirv"))]
26pub use host::{Device, GpuRecordsEncoder};
27#[cfg(not(target_arch = "spirv"))]
28pub use wgpu::{Backend, DeviceType};
29
30// TODO: Remove gate after https://github.com/Rust-GPU/rust-gpu/pull/249
31#[cfg(not(target_arch = "spirv"))]
32const _: () = {
33    assert!(PosProof::K >= 15 && PosProof::K <= 24);
34};