[package]
name = "baracuda-kernels-sys"
version = "0.0.1-alpha.47"
description = "Compiled bespoke .cu kernel template instantiations for the baracuda ML kernel facade plus C-ABI FFI facades for the library-backed plans (cuDNN conv/pool, cuSOLVER linalg, cuFFT/cuRAND, CUTLASS GEMM re-export). Hosts curated CUDA kernel sources (int8/FP8/int4/bin GEMM RRR, elementwise, reduce, norm, attention, …), builds them via baracuda-forge, exposes extern \"C\" entry points for the safe baracuda-kernels crate. CUTLASS template kernels live in the sibling baracuda-cutlass-kernels-sys crate and are re-exported here under the unified baracuda_kernels_gemm_* namespace."
edition.workspace = true
rust-version.workspace = true
license.workspace = true
authors.workspace = true
repository.workspace = true
homepage.workspace = true
keywords = ["cuda", "kernel", "gemm", "ml", "ffi"]
categories = ["external-ffi-bindings", "science"]
links = "baracuda_kernels"
build = "build.rs"
# Belt-and-suspenders: prevent .profraw coverage files from accidentally
# being included in the crates.io tarball.
exclude = ["*.profraw", "target/"]

[features]
# Default to Ampere (sm_80) — runs on Ampere, Ada (RTX 40-series), and
# as forward-compatible fallback on Hopper if `sm_90a` isn't enabled.
default = ["sm80"]

# Build the sm_80 (Ampere / Ada-fallback) kernel set. Phase 24 forwards
# to baracuda-cutlass-kernels-sys/sm80 so the cutlass GEMM trampolines
# in `cutlass_reexport` resolve at link time.
sm80 = ["baracuda-cutlass-kernels-sys/sm80"]

# Build the sm_89 (Ada Lovelace) kernel set. Adds FP8 over sm_80.
sm89 = []

# Build the sm_90a (Hopper async) kernel set. Phase 24 forwards to
# baracuda-cutlass-kernels-sys/sm90a.
sm90a = ["baracuda-cutlass-kernels-sys/sm90a"]

# Link against cuDNN and expose the cuDNN FFI surface (Phase 7 conv /
# pool / CTC-cuDNN plans). Off by default because cuDNN is a separate
# NVIDIA download not bundled with the stock CUDA toolkit installer —
# enabling without cuDNN installed produces a linker error on
# `cudnn.lib` / `libcudnn.so`.
cudnn = []

[dependencies]
# Phase 24 — cutlass GEMM FFI re-export. Pull in the CUTLASS template
# instantiations so the unified `baracuda_kernels_gemm_*` namespace can
# trampoline to them. Different `links` key (`baracuda_cutlass_kernels`
# vs `baracuda_kernels`) so the two static archives co-exist without
# Cargo's links-conflict guard tripping.
baracuda-cutlass-kernels-sys = { workspace = true }

[build-dependencies]
baracuda-forge = { workspace = true }

# docs.rs builds with --all-features by default; we only want the
# baseline (sm80) build to be attempted on docs.rs.
[package.metadata.docs.rs]
features = ["sm80"]
no-default-features = false
