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#![cfg_attr(
8    not(target_arch = "spirv"),
9    feature(iter_array_chunks, macroless_generic_const_args, portable_simd)
10)]
11#![feature(
12    funnel_shifts,
13    generic_const_args,
14    generic_const_items,
15    min_generic_const_args,
16    mut_restriction,
17    step_trait
18)]
19#![expect(incomplete_features, reason = "generic_const_*")]
20#![cfg_attr(
21    all(test, not(target_arch = "spirv")),
22    feature(const_convert, const_trait_impl)
23)]
24#![cfg_attr(
25    all(test, not(any(miri, target_arch = "spirv"))),
26    feature(maybe_uninit_fill)
27)]
28// TODO: Remove if/when this is addressed:
29//  https://github.com/rust-lang/rust-clippy/issues/17524#issuecomment-5405010966
30#![cfg_attr(test, expect(clippy::manual_assert_eq, reason = "False-positive"))]
31// TODO: Remove once https://github.com/gfx-rs/wgpu/pull/9953 is released
32#![recursion_limit = "256"]
33
34#[cfg(not(target_arch = "spirv"))]
35mod host;
36// This is used for benchmarks of isolated shaders externally, not for general use
37#[doc(hidden)]
38pub mod shader;
39
40// TODO: Remove gate after https://github.com/Rust-GPU/rust-gpu/pull/249
41#[cfg(not(target_arch = "spirv"))]
42use ab_core_primitives::pos::PosProof;
43#[cfg(not(target_arch = "spirv"))]
44pub use host::{Device, GpuRecordsEncoder};
45#[cfg(not(target_arch = "spirv"))]
46pub use wgpu::{Backend, DeviceType};
47
48// TODO: Remove gate after https://github.com/Rust-GPU/rust-gpu/pull/249
49#[cfg(not(target_arch = "spirv"))]
50const _: () = {
51    assert!(PosProof::K >= 15 && PosProof::K <= 24);
52};