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