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)
17)]
18#![cfg_attr(
19    all(test, not(any(miri, target_arch = "spirv"))),
20    feature(maybe_uninit_fill)
21)]
22// TODO: Remove if/when this is addressed:
23//  https://github.com/rust-lang/rust-clippy/issues/17524#issuecomment-5405010966
24#![cfg_attr(test, expect(clippy::manual_assert_eq, reason = "False-positive"))]
25// TODO: Remove once https://github.com/gfx-rs/wgpu/pull/9953 is released
26#![recursion_limit = "256"]
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};