use crate::ir::DataType;
use crate::ops::Backend;
use crate::ops::{IntrinsicDescriptor, OpSpec};
pub const WGSL: &str = include_str!("wgsl/xxhash64.wgsl");
pub const INPUTS: &[DataType] = &[DataType::Bytes];
pub const LAWS: &[crate::ops::AlgebraicLaw] = &[];
pub const OUTPUTS: &[DataType] = &[DataType::U64];
pub const SPEC: OpSpec = OpSpec::intrinsic(
"hash.xxhash64",
INPUTS,
OUTPUTS,
LAWS,
wgsl_only,
IntrinsicDescriptor::new(
"hash.xxhash64.wgsl",
"wgsl-xxhash64",
crate::ops::hash::cpu_refs::xxhash64,
),
);
pub fn wgsl_only(backend: &Backend) -> bool {
matches!(backend, Backend::Wgsl)
}
#[must_use]
pub fn xxhash64(input: &[u8]) -> u64 {
crate::ops::hash::reference::xxhash::xxhash64(input)
}