Add inline declarations on hstack, vstack, and visit. Reorder const parameters to the end of declarations to support the rustc version used by the cuda test suite.

This commit is contained in:
Avi Weinstock 2023-01-31 17:51:55 -05:00
parent 317aef574a
commit be45282263

View File

@ -37,6 +37,7 @@ macro_rules! impl_visit_tuple {
impl<$i, Func: Visitor<$i>> VisitTuple<Func> for ($i,) { impl<$i, Func: Visitor<$i>> VisitTuple<Func> for ($i,) {
type Output = <Func as Visitor<$i>>::Output; type Output = <Func as Visitor<$i>>::Output;
#[allow(non_snake_case)] #[allow(non_snake_case)]
#[inline(always)]
fn visit(visitor: Func, ($i,): Self) -> Self::Output { fn visit(visitor: Func, ($i,): Self) -> Self::Output {
visitor.visit($i) visitor.visit($i)
} }
@ -48,6 +49,7 @@ macro_rules! impl_visit_tuple {
{ {
type Output = <($($is,)*) as VisitTuple<<Func as Visitor<$i>>::Output>>::Output; type Output = <($($is,)*) as VisitTuple<<Func as Visitor<$i>>::Output>>::Output;
#[allow(non_snake_case)] #[allow(non_snake_case)]
#[inline(always)]
fn visit(visitor: Func, ($i, $($is),*): Self) -> Self::Output { fn visit(visitor: Func, ($i, $($is),*): Self) -> Self::Output {
VisitTuple::visit(visitor.visit($i), ($($is,)*)) VisitTuple::visit(visitor.visit($i), ($($is,)*))
} }
@ -103,10 +105,10 @@ mod vstack_impl {
R1: Dim + DimAdd<Const<R2>>, R1: Dim + DimAdd<Const<R2>>,
C1: Dim, C1: Dim,
S1: RawStorageMut<T, R1, C1>, S1: RawStorageMut<T, R1, C1>,
const R2: usize,
C2: Dim, C2: Dim,
S2: RawStorage<T, Const<R2>, C2>, S2: RawStorage<T, Const<R2>, C2>,
R3: Dim + DimAdd<Const<R2>>, R3: Dim + DimAdd<Const<R2>>,
const R2: usize,
> Visitor<&Matrix<T, Const<R2>, C2, S2>> for VStack<T, R1, C1, S1, R3> > Visitor<&Matrix<T, Const<R2>, C2, S2>> for VStack<T, R1, C1, S1, R3>
where where
ShapeConstraint: SameNumberOfColumns<C1, C2>, ShapeConstraint: SameNumberOfColumns<C1, C2>,
@ -152,6 +154,7 @@ mod vstack_impl {
/// Stack a tuple of references to matrices with equal column counts vertically, yielding a /// Stack a tuple of references to matrices with equal column counts vertically, yielding a
/// matrix with every row of the input matrices. /// matrix with every row of the input matrices.
#[inline]
pub fn vstack< pub fn vstack<
T: Scalar + Zero, T: Scalar + Zero,
R: Dim, R: Dim,
@ -227,9 +230,9 @@ mod hstack_impl {
C1: Dim + DimAdd<Const<C2>>, C1: Dim + DimAdd<Const<C2>>,
S1: RawStorageMut<T, R1, C1>, S1: RawStorageMut<T, R1, C1>,
R2: Dim, R2: Dim,
const C2: usize,
S2: RawStorage<T, R2, Const<C2>>, S2: RawStorage<T, R2, Const<C2>>,
C3: Dim + DimAdd<Const<C2>>, C3: Dim + DimAdd<Const<C2>>,
const C2: usize,
> Visitor<&Matrix<T, R2, Const<C2>, S2>> for HStack<T, R1, C1, S1, C3> > Visitor<&Matrix<T, R2, Const<C2>, S2>> for HStack<T, R1, C1, S1, C3>
where where
ShapeConstraint: SameNumberOfRows<R1, R2>, ShapeConstraint: SameNumberOfRows<R1, R2>,
@ -275,6 +278,7 @@ mod hstack_impl {
/// Stack a tuple of references to matrices with equal row counts horizontally, yielding a /// Stack a tuple of references to matrices with equal row counts horizontally, yielding a
/// matrix with every column of the input matrices. /// matrix with every column of the input matrices.
#[inline]
pub fn hstack< pub fn hstack<
T: Scalar + Zero, T: Scalar + Zero,
R: Dim, R: Dim,