vyre 0.4.0

GPU compute intermediate representation with a standard operation library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18


//! WGSL lowering source for `buffer.byte_swap_u64`.

/// Dispatchable WGSL kernel for two-word `u64` byte swapping.
pub const WGSL: &str = include_str!("wgsl/byte_swap_u64.wgsl");

/// Reverse the byte order of a `u64`.
#[must_use]
pub const fn byte_swap_u64(value: u64) -> u64 {
    value.swap_bytes()
}

/// Reverse the byte order of a `(lo, hi)` two-`u32` `U64` representation.
#[must_use]
pub const fn byte_swap_u64_words(lo: u32, hi: u32) -> (u32, u32) {
    (hi.swap_bytes(), lo.swap_bytes())
}