khal-std 0.2.0

GPU standard library for khal compute shaders, with cross-platform primitives compiling to SPIR-V, CUDA PTX, and CPU targets.
Documentation
[package]
name = "khal-std"
authors = ["Sébastien Crozet <sebcrozet@dimforge.com>"]
description = "GPU standard library for khal compute shaders, with cross-platform primitives compiling to SPIR-V, CUDA PTX, and CPU targets."
repository = "https://github.com/dimforge/khal"
version = { workspace = true }
edition = "2024"
license = "MIT OR Apache-2.0"

[features]
cpu = ["corosensei"]
cpu-parallel = ["cpu", "rayon"]
cuda = []

# If this feature is enabled, some bound-checking will be disabled,
# possibly leading to UB if indexing out-of-bounds.
# There are two main situations where enabling this feature is desirable:
# - To get a sense of the overhead of bounds-checking on the GPU shader.
# - To disable bound-checking that breaks uniform execution frows when workgroup
#   barriers are involved. This is important when targetting the browser since it
#   enforces a uniform control flow check on shaders involving barriers. Without
#   enabling this feature, some shaders will fail to compile on the web.
# The recommendation is to debug with this feature **disabled**. And enable it only
# for deploying to the web.
unsafe_remove_boundchecks = []

[dependencies]
glamx = { version = "0.3", default-features = false, features = ["nostd-libm", "bytemuck", "u32", "i32", "f64"] }
rayon = { version = "1", optional = true }
corosensei = { version = "0.3", optional = true }
spirv-std-macros = "0.10.0-alpha.1"
khal-derive = { version = "0.2.0", path = "../khal-derive" }

[lints]
workspace = true

[target.'cfg(not(target_arch = "nvptx64"))'.dependencies]
spirv-std = "0.10.0-alpha.1"

[target.'cfg(target_arch = "nvptx64")'.dependencies]
# Fixes the UVec3::element_product bug
#cuda_std = { git = "https://github.com/sebcrozet/Rust-CUDA.git", branch = "glam-up" }