Skip to main content

oxicuda_blas/elementwise/
mod.rs

1//! Elementwise GPU operations for OxiCUDA BLAS.
2//!
3//! This module provides unary and binary elementwise operations over device
4//! buffers, including activation functions (ReLU, GELU, sigmoid, SiLU, tanh),
5//! scaling, and fused operations (add+relu, scale+add).
6//!
7//! Each function generates PTX on the fly via [`oxicuda_ptx::templates::elementwise::ElementwiseTemplate`] from
8//! `oxicuda-ptx`, loads the resulting module, and launches the kernel on the
9//! handle's stream.
10
11mod binary;
12mod broadcast;
13mod fill;
14mod ops;
15mod unary;
16
17pub use binary::{
18    add, cmp_eq, cmp_ge, cmp_gt, cmp_le, cmp_lt, cmp_ne, div, fused_add_relu, fused_scale_add, max,
19    min, mul, nand, nor, or_max, or_prob_sum, pow, sub, xor,
20};
21pub use broadcast::broadcast_axes;
22pub use fill::fill;
23pub use ops::ElementwiseOp;
24pub use unary::{
25    abs_val, ceil, exp, floor, gelu, hard_sigmoid, hard_swish, leaky_relu, log, neg, one_minus,
26    relu, rsqrt, scale, sigmoid, silu, softplus, sqrt, tanh_activation,
27};