pub trait ReductionScalar:
Copy
+ Send
+ Sync
+ Debug
+ Default
+ 'static {
// Required methods
fn identity(op: ReductionOp) -> Self;
fn combine(a: Self, b: Self, op: ReductionOp) -> Self;
fn cuda_type() -> &'static str;
fn wgsl_type() -> &'static str;
// Provided method
fn size_bytes() -> usize { ... }
}Expand description
Trait for scalar types that support reduction operations.
Implementors must provide identity values for each reduction operation.
The identity value is the neutral element such that op(x, identity) = x.
Required Methods§
Sourcefn identity(op: ReductionOp) -> Self
fn identity(op: ReductionOp) -> Self
Get the identity value for the given reduction operation.
Sourcefn combine(a: Self, b: Self, op: ReductionOp) -> Self
fn combine(a: Self, b: Self, op: ReductionOp) -> Self
Combine two values according to the reduction operation.
Provided Methods§
Sourcefn size_bytes() -> usize
fn size_bytes() -> usize
Size in bytes.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.