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