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

Segments moved from Containers to Algorithms.

parent 9ddb7399
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -15,14 +15,14 @@ void createMatrixView()
   /***
    * Create dense matrix view with row major order
    */
   TNL::Matrices::DenseMatrixView< double, Device, int, TNL::Containers::Segments::RowMajorOrder > rowMajorMatrix( 3, 4, values.getView() );
   TNL::Matrices::DenseMatrixView< double, Device, int, TNL::Algorithms::Segments::RowMajorOrder > rowMajorMatrix( 3, 4, values.getView() );
   std::cout << "Row major order matrix:" << std::endl;
   std::cout << rowMajorMatrix << std::endl;

   /***
    * Create dense matrix view with column major order
    */
   TNL::Matrices::DenseMatrixView< double, Device, int, TNL::Containers::Segments::RowMajorOrder > columnMajorMatrix( 4, 3, values.getView() );
   TNL::Matrices::DenseMatrixView< double, Device, int, TNL::Algorithms::Segments::RowMajorOrder > columnMajorMatrix( 4, 3, values.getView() );
   std::cout << "Column major order matrix:" << std::endl;
   std::cout << columnMajorMatrix << std::endl;
}
+2 −2
Original line number Diff line number Diff line
@@ -31,10 +31,10 @@
#include "ordering.h"

#include <TNL/Matrices/SparseMatrix.h>
#include <TNL/Containers/Segments/SlicedEllpack.h>
#include <TNL/Algorithms/Segments/SlicedEllpack.h>

template< typename _Device, typename _Index, typename _IndexAlocator >
using SegmentsType = TNL::Containers::Segments::SlicedEllpack< _Device, _Index, _IndexAlocator >;
using SegmentsType = TNL::Algorithms::Segments::SlicedEllpack< _Device, _Index, _IndexAlocator >;

using namespace TNL;
using namespace TNL::Benchmarks;
+6 −6
Original line number Diff line number Diff line
@@ -56,11 +56,11 @@
#endif

#include <TNL/Matrices/SparseMatrix.h>
#include <TNL/Containers/Segments/CSR.h>
#include <TNL/Containers/Segments/SlicedEllpack.h>
#include <TNL/Algorithms/Segments/CSR.h>
#include <TNL/Algorithms/Segments/SlicedEllpack.h>

template< typename _Device, typename _Index, typename _IndexAlocator >
using SegmentsType = TNL::Containers::Segments::SlicedEllpack< _Device, _Index, _IndexAlocator >;
using SegmentsType = TNL::Algorithms::Segments::SlicedEllpack< _Device, _Index, _IndexAlocator >;

using namespace TNL;
using namespace TNL::Benchmarks;
@@ -502,7 +502,7 @@ struct LinearSolversBenchmark
                                                  DeviceType,
                                                  IndexType,
                                                  TNL::Matrices::GeneralMatrix,
                                                  Containers::Segments::CSR
                                                  Algorithms::Segments::CSR
                                                >;
         SharedPointer< CSR > matrixCopy;
         Matrices::copySparseMatrix( *matrixCopy, *matrixPointer );
@@ -530,7 +530,7 @@ struct LinearSolversBenchmark
                                                  DeviceType,
                                                  IndexType,
                                                  TNL::Matrices::GeneralMatrix,
                                                  Containers::Segments::CSR
                                                  Algorithms::Segments::CSR
                                                >;
         SharedPointer< CSR > matrixCopy;
         Matrices::copySparseMatrix( *matrixCopy, *matrixPointer );
@@ -539,7 +539,7 @@ struct LinearSolversBenchmark
                                                      Devices::Cuda,
                                                      IndexType,
                                                      TNL::Matrices::GeneralMatrix,
                                                      Containers::Segments::CSR
                                                      Algorithms::Segments::CSR
                                                    >;
         using CudaVector = typename VectorType::template Self< RealType, Devices::Cuda >;
         SharedPointer< CudaCSR > cuda_matrixCopy;
+10 −10
Original line number Diff line number Diff line
@@ -30,11 +30,11 @@

#include <TNL/Matrices/SparseMatrix.h>
#include <TNL/Matrices/MatrixType.h>
#include <TNL/Containers/Segments/CSR.h>
#include <TNL/Containers/Segments/Ellpack.h>
#include <TNL/Containers/Segments/SlicedEllpack.h>
#include <TNL/Containers/Segments/ChunkedEllpack.h>
#include <TNL/Containers/Segments/BiEllpack.h>
#include <TNL/Algorithms/Segments/CSR.h>
#include <TNL/Algorithms/Segments/Ellpack.h>
#include <TNL/Algorithms/Segments/SlicedEllpack.h>
#include <TNL/Algorithms/Segments/ChunkedEllpack.h>
#include <TNL/Algorithms/Segments/BiEllpack.h>
using namespace TNL::Matrices;

#include "cusparseCSRMatrix.h"
@@ -49,28 +49,28 @@ using SlicedEllpackAlias = Matrices::Legacy::SlicedEllpack< Real, Device, Index

// Segments based sparse matrix aliases
template< typename Real, typename Device, typename Index >
using SparseMatrix_CSR = Matrices::SparseMatrix< Real, Device, Index, Matrices::GeneralMatrix, Containers::Segments::CSR >;
using SparseMatrix_CSR = Matrices::SparseMatrix< Real, Device, Index, Matrices::GeneralMatrix, Algorithms::Segments::CSR >;

template< typename Device, typename Index, typename IndexAllocator >
using EllpackSegments = Containers::Segments::Ellpack< Device, Index, IndexAllocator >;
using EllpackSegments = Algorithms::Segments::Ellpack< Device, Index, IndexAllocator >;

template< typename Real, typename Device, typename Index >
using SparseMatrix_Ellpack = Matrices::SparseMatrix< Real, Device, Index, Matrices::GeneralMatrix, EllpackSegments >;

template< typename Device, typename Index, typename IndexAllocator >
using SlicedEllpackSegments = Containers::Segments::SlicedEllpack< Device, Index, IndexAllocator >;
using SlicedEllpackSegments = Algorithms::Segments::SlicedEllpack< Device, Index, IndexAllocator >;

template< typename Real, typename Device, typename Index >
using SparseMatrix_SlicedEllpack = Matrices::SparseMatrix< Real, Device, Index, Matrices::GeneralMatrix, SlicedEllpackSegments >;

template< typename Device, typename Index, typename IndexAllocator >
using ChunkedEllpackSegments = Containers::Segments::ChunkedEllpack< Device, Index, IndexAllocator >;
using ChunkedEllpackSegments = Algorithms::Segments::ChunkedEllpack< Device, Index, IndexAllocator >;

template< typename Real, typename Device, typename Index >
using SparseMatrix_ChunkedEllpack = Matrices::SparseMatrix< Real, Device, Index, Matrices::GeneralMatrix, ChunkedEllpackSegments >;

template< typename Device, typename Index, typename IndexAllocator >
using BiEllpackSegments = Containers::Segments::BiEllpack< Device, Index, IndexAllocator >;
using BiEllpackSegments = Algorithms::Segments::BiEllpack< Device, Index, IndexAllocator >;

template< typename Real, typename Device, typename Index >
using SparseMatrix_BiEllpack = Matrices::SparseMatrix< Real, Device, Index, Matrices::GeneralMatrix, BiEllpackSegments >;
+8 −8
Original line number Diff line number Diff line
@@ -12,17 +12,17 @@

#include <TNL/Allocators/Default.h>
#include <TNL/Containers/Vector.h>
#include <TNL/Containers/Segments/BiEllpackView.h>
#include <TNL/Containers/Segments/SegmentView.h>
#include <TNL/Algorithms/Segments/BiEllpackView.h>
#include <TNL/Algorithms/Segments/SegmentView.h>

namespace TNL {
   namespace Containers {
   namespace Algorithms {
      namespace Segments {

template< typename Device,
          typename Index,
          typename IndexAllocator = typename Allocators::Default< Device >::template Allocator< Index >,
          ElementsOrganization Organization = Containers::Segments::DefaultElementsOrganization< Device >::getOrganization(),
          ElementsOrganization Organization = Algorithms::Segments::DefaultElementsOrganization< Device >::getOrganization(),
          int WarpSize = 32 >
class BiEllpack
{
@@ -40,7 +40,7 @@ class BiEllpack

      BiEllpack() = default;

      BiEllpack( const Vector< IndexType, DeviceType, IndexType >& sizes );
      BiEllpack( const Containers::Vector< IndexType, DeviceType, IndexType >& sizes );

      BiEllpack( const BiEllpack& segments );

@@ -167,8 +167,8 @@ class BiEllpack
      friend class BiEllpack;
};

      } // namespace Segements
   }  // namespace Conatiners
      } // namespace Segments
   }  // namespace Algorithms
} // namespace TNL

#include <TNL/Containers/Segments/BiEllpack.hpp>
#include <TNL/Algorithms/Segments/BiEllpack.hpp>
Loading