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
use super::DataMovementError;

pub(crate) fn read_u32_words_le(bytes: &[u8]) -> Result<Vec<u32>, DataMovementError> {
    if bytes.len() % 4 != 0 {
        return Err(DataMovementError::MisalignedIndices { len: bytes.len() });
    }

    Ok(bytes
        .chunks_exact(4)
        .map(|chunk| u32::from_le_bytes([chunk[0], chunk[1], chunk[2], chunk[3]]))
        .collect())
}