rstsr_openblas/rayon_auto_impl/
assignment.rs

1use crate::prelude_dev::*;
2
3impl<TC, TA, DC, DA> OpAssignArbitaryAPI<TC, DC, DA, TA> for DeviceRayonAutoImpl
4where
5    TC: Clone + Send + Sync,
6    TA: Clone + Send + Sync + DTypeCastAPI<TC>,
7    DC: DimAPI,
8    DA: DimAPI,
9{
10    fn assign_arbitary(&self, c: &mut Vec<TC>, lc: &Layout<DC>, a: &Vec<TA>, la: &Layout<DA>) -> Result<()> {
11        let pool = self.get_current_pool();
12        let default_order = self.default_order();
13        assign_arbitary_promote_cpu_rayon(c, lc, a, la, default_order, pool)
14    }
15
16    fn assign_arbitary_uninit(
17        &self,
18        c: &mut Vec<MaybeUninit<TC>>,
19        lc: &Layout<DC>,
20        a: &Vec<TA>,
21        la: &Layout<DA>,
22    ) -> Result<()> {
23        let pool = self.get_current_pool();
24        let default_order = self.default_order();
25        return assign_arbitary_uninit_promote_cpu_rayon(c, lc, a, la, default_order, pool);
26    }
27}
28
29impl<TC, TA, D> OpAssignAPI<TC, D, TA> for DeviceRayonAutoImpl
30where
31    TC: Clone + Send + Sync,
32    TA: Clone + Send + Sync + DTypeCastAPI<TC>,
33    D: DimAPI,
34{
35    fn assign(&self, c: &mut Vec<TC>, lc: &Layout<D>, a: &Vec<TA>, la: &Layout<D>) -> Result<()> {
36        let pool = self.get_current_pool();
37        assign_promote_cpu_rayon(c, lc, a, la, pool)
38    }
39
40    fn assign_uninit(&self, c: &mut Vec<MaybeUninit<TC>>, lc: &Layout<D>, a: &Vec<TA>, la: &Layout<D>) -> Result<()> {
41        let pool = self.get_current_pool();
42        return assign_uninit_promote_cpu_rayon(c, lc, a, la, pool);
43    }
44
45    fn fill(&self, c: &mut Vec<TC>, lc: &Layout<D>, fill: TA) -> Result<()> {
46        let pool = self.get_current_pool();
47        fill_promote_cpu_rayon(c, lc, fill, pool)
48    }
49}