Commit b2bd2047 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Added missing asserts to DistributedArrayView and preconditioners

parent e168168d
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -51,7 +51,10 @@ public:
   __cuda_callable__
   DistributedArrayView( const LocalRangeType& localRange, IndexType globalSize, CommunicationGroup group, LocalViewType localData )
   : localRange(localRange), globalSize(globalSize), group(group), localData(localData)
   {}
   {
      TNL_ASSERT_EQ( localData.getSize(), localRange.getSize(),
                     "The local array size does not match the local range of the distributed array." );
   }

   __cuda_callable__
   DistributedArrayView() = default;
+3 −0
Original line number Diff line number Diff line
@@ -91,6 +91,9 @@ solve( ConstVectorViewType b, VectorViewType x ) const
   const auto b_view = b.getConstLocalView();
   auto x_view = x.getLocalView();

   TNL_ASSERT_EQ( b_view.getSize(), diagonal.getSize(), "The size of the vector b does not match the size of the extracted diagonal." );
   TNL_ASSERT_EQ( x_view.getSize(), diagonal.getSize(), "The size of the vector x does not match the size of the extracted diagonal." );

   auto kernel = [=] __cuda_callable__ ( IndexType i ) mutable
   {
      x_view[ i ] = b_view[ i ] / diag_view[ i ];
+3 −0
Original line number Diff line number Diff line
@@ -137,6 +137,9 @@ solve( ConstVectorViewType _b, VectorViewType _x ) const
   const auto b = Traits< Matrix >::getConstLocalView( _b );
   auto x = Traits< Matrix >::getLocalView( _x );

   TNL_ASSERT_EQ( b.getSize(), L.getRows(), "The size of the vector b does not match the size of the decomposed matrix." );
   TNL_ASSERT_EQ( x.getSize(), U.getRows(), "The size of the vector x does not match the size of the decomposed matrix." );

   // Step 1: solve y from Ly = b
   triangularSolveLower< true >( L, x, b );