furiosa_visa_std/vector_engine/
layer.rs

1//! Layer configurations for Vector Engine pipeline.
2
3use smart_default::SmartDefault;
4
5/// VectorEngine FxpToFp layer configuration.
6#[derive(Debug, Clone, Copy, SmartDefault)]
7pub struct FxpToFp(u32);
8
9impl FxpToFp {
10    /// Creates a new FxpToFp configuration with the given integer width.
11    pub fn new(int_width: u32) -> Self {
12        Self(int_width)
13    }
14
15    /// Returns the integer width.
16    pub fn int_width(&self) -> u32 {
17        self.0
18    }
19}
20
21/// VectorEngine FpToFxp layer configuration.
22#[derive(Debug, Clone, Copy, SmartDefault)]
23pub struct FpToFxp(u32);
24
25impl FpToFxp {
26    /// Creates a new FpToFxp configuration with the given integer width.
27    pub fn new(int_width: u32) -> Self {
28        Self(int_width)
29    }
30
31    /// Returns the integer width.
32    pub fn int_width(&self) -> u32 {
33        self.0
34    }
35}