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