Loading Documentation/Examples/Matrices/SparseMatrix/SparseMatrixExample_forAllRows.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -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; } }; Loading Documentation/Examples/Matrices/SparseMatrix/SparseMatrixExample_forRows.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -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; } }; Loading Documentation/Examples/Matrices/SparseMatrix/SparseMatrixViewExample_forAllRows.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -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; } }; Loading Documentation/Examples/Matrices/SparseMatrix/SparseMatrixViewExample_forRows.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -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; } }; Loading Documentation/Tutorials/Matrices/CMakeLists.txt +5 −0 Original line number Diff line number Diff line Loading @@ -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 ) Loading @@ -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 Loading
Documentation/Examples/Matrices/SparseMatrix/SparseMatrixExample_forAllRows.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -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; } }; Loading
Documentation/Examples/Matrices/SparseMatrix/SparseMatrixExample_forRows.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -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; } }; Loading
Documentation/Examples/Matrices/SparseMatrix/SparseMatrixViewExample_forAllRows.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -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; } }; Loading
Documentation/Examples/Matrices/SparseMatrix/SparseMatrixViewExample_forRows.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -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; } }; Loading
Documentation/Tutorials/Matrices/CMakeLists.txt +5 −0 Original line number Diff line number Diff line Loading @@ -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 ) Loading @@ -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