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