rstsr_core/storage/
assignment.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! Data assignments on device

use crate::prelude_dev::*;

pub trait OpAssignArbitaryAPI<T, DC, DA>
where
    DC: DimAPI,
    DA: DimAPI,
    Self: DeviceAPI<T>,
{
    /// Element-wise assignment in col-major order, without no promise that
    /// input layouts are broadcastable.
    fn assign_arbitary(
        &self,
        c: &mut <Self as DeviceRawAPI<T>>::Raw,
        lc: &Layout<DC>,
        a: &<Self as DeviceRawAPI<T>>::Raw,
        la: &Layout<DA>,
    ) -> Result<()>;
}

pub trait OpAssignAPI<T, D>
where
    D: DimAPI,
    Self: DeviceAPI<T>,
{
    /// Element-wise assignment for same layout arrays.
    fn assign(
        &self,
        c: &mut <Self as DeviceRawAPI<T>>::Raw,
        lc: &Layout<D>,
        a: &<Self as DeviceRawAPI<T>>::Raw,
        la: &Layout<D>,
    ) -> Result<()>;

    fn fill(&self, c: &mut <Self as DeviceRawAPI<T>>::Raw, lc: &Layout<D>, fill: T) -> Result<()>;
}