Commit e4091257 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Writting documentation on sparse matrices.

parent aa1dbbc2
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -9,13 +9,13 @@ void forAllRowsExample()
   TNL::Matrices::SparseMatrix< double, Device > matrix( { 1, 2, 3, 4, 5 }, 5 );

   auto f = [=] __cuda_callable__ ( int rowIdx, int localIdx, int& columnIdx, double& value, bool& compute ) {
      if( rowIdx < columnIdx )  // This is important, some matrix formats may allocate more matrix elements
      if( rowIdx < localIdx )  // This is important, some matrix formats may allocate more matrix elements
                               // than we requested. These padding elements are processed here as well.
         compute = false;
      else
      {
         columnIdx = localIdx;
         value = rowIdx + localIdx;
         value = rowIdx + localIdx + 1;
      }
   };

+3 −3
Original line number Diff line number Diff line
@@ -9,13 +9,13 @@ void forRowsExample()
   TNL::Matrices::SparseMatrix< double, Device > matrix( { 1, 2, 3, 4, 5 }, 5 );

   auto f = [=] __cuda_callable__ ( int rowIdx, int localIdx, int& columnIdx, double& value, bool& compute ) {
      if( rowIdx < columnIdx )  // This is important, some matrix formats may allocate more matrix elements
      if( rowIdx < localIdx )  // This is important, some matrix formats may allocate more matrix elements
                               // than we requested. These padding elements are processed here as well.
         compute = false;
      else
      {
         columnIdx = localIdx;
         value = rowIdx + localIdx;
         value = rowIdx + localIdx + 1;
      }
   };

+3 −3
Original line number Diff line number Diff line
@@ -10,13 +10,13 @@ void forAllRowsExample()
   auto view = matrix.getView();

   auto f = [=] __cuda_callable__ ( int rowIdx, int localIdx, int& columnIdx, double& value, bool& compute ) {
      if( rowIdx < columnIdx )  // This is important, some matrix formats may allocate more matrix elements
      if( rowIdx < localIdx )  // This is important, some matrix formats may allocate more matrix elements
                               // than we requested. These padding elements are processed here as well.
         compute = false;
      else
      {
         columnIdx = localIdx;
         value = rowIdx + localIdx;
         value = rowIdx + localIdx + 1;
      }
   };

+3 −3
Original line number Diff line number Diff line
@@ -10,13 +10,13 @@ void forRowsExample()
   auto view = matrix.getView();

   auto f = [=] __cuda_callable__ ( int rowIdx, int localIdx, int& columnIdx, double& value, bool& compute ) {
      if( rowIdx < columnIdx )  // This is important, some matrix formats may allocate more matrix elements
      if( rowIdx < localIdx )  // This is important, some matrix formats may allocate more matrix elements
                               // than we requested. These padding elements are processed here as well.
         compute = false;
      else
      {
         columnIdx = localIdx;
         value = rowIdx + localIdx;
         value = rowIdx + localIdx + 1;
      }
   };

+5 −0
Original line number Diff line number Diff line
@@ -79,6 +79,10 @@ IF( BUILD_CUDA )
                       ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/SparseMatrixExample_forRows.out
                       OUTPUT SparseMatrixExample_forRows.out )

   CUDA_ADD_EXECUTABLE( SparseMatrixExample_rowsReduction_vectorProduct SparseMatrixExample_rowsReduction_vectorProduct.cu )
   ADD_CUSTOM_COMMAND( COMMAND SparseMatrixExample_rowsReduction_vectorProduct >
                       ${TNL_DOCUMENTATION_OUTPUT_SNIPPETS_PATH}/SparseMatrixExample_rowsReduction_vectorProduct.out
                       OUTPUT SparseMatrixExample_rowsReduction_vectorProduct.out )

ELSE()
#   ADD_EXECUTABLE( UniquePointerExample UniquePointerExample.cpp )
@@ -105,6 +109,7 @@ ADD_CUSTOM_TARGET( TutorialsMatricesCuda ALL DEPENDS
   SparseMatrixExample_setElements_map.out
   SparseMatrixExample_setElement.out
   SparseMatrixExample_forRows.out
   SparseMatrixExample_rowsReduction_vectorProduct.out
 )
ENDIF()
#
Loading