From be452822631e6e0f3f145382985c900a3845c194 Mon Sep 17 00:00:00 2001 From: Avi Weinstock Date: Tue, 31 Jan 2023 17:51:55 -0500 Subject: [PATCH] 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. --- src/base/stacking.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/base/stacking.rs b/src/base/stacking.rs index 3e249152..6d3432ce 100644 --- a/src/base/stacking.rs +++ b/src/base/stacking.rs @@ -37,6 +37,7 @@ macro_rules! impl_visit_tuple { impl<$i, Func: Visitor<$i>> VisitTuple for ($i,) { type Output = >::Output; #[allow(non_snake_case)] + #[inline(always)] fn visit(visitor: Func, ($i,): Self) -> Self::Output { visitor.visit($i) } @@ -48,6 +49,7 @@ macro_rules! impl_visit_tuple { { type Output = <($($is,)*) as VisitTuple<>::Output>>::Output; #[allow(non_snake_case)] + #[inline(always)] fn visit(visitor: Func, ($i, $($is),*): Self) -> Self::Output { VisitTuple::visit(visitor.visit($i), ($($is,)*)) } @@ -103,10 +105,10 @@ mod vstack_impl { R1: Dim + DimAdd>, C1: Dim, S1: RawStorageMut, - const R2: usize, C2: Dim, S2: RawStorage, C2>, R3: Dim + DimAdd>, + const R2: usize, > Visitor<&Matrix, C2, S2>> for VStack where ShapeConstraint: SameNumberOfColumns, @@ -152,6 +154,7 @@ mod vstack_impl { /// Stack a tuple of references to matrices with equal column counts vertically, yielding a /// matrix with every row of the input matrices. + #[inline] pub fn vstack< T: Scalar + Zero, R: Dim, @@ -227,9 +230,9 @@ mod hstack_impl { C1: Dim + DimAdd>, S1: RawStorageMut, R2: Dim, - const C2: usize, S2: RawStorage>, C3: Dim + DimAdd>, + const C2: usize, > Visitor<&Matrix, S2>> for HStack where ShapeConstraint: SameNumberOfRows, @@ -275,6 +278,7 @@ mod hstack_impl { /// Stack a tuple of references to matrices with equal row counts horizontally, yielding a /// matrix with every column of the input matrices. + #[inline] pub fn hstack< T: Scalar + Zero, R: Dim,