Loading src/TNL/Matrices/Legacy/CSR.h +26 −0 Original line number Diff line number Diff line Loading @@ -15,11 +15,30 @@ #include <TNL/Devices/Cuda.h> #include <TNL/Exceptions/CudaBadAlloc.h> #include <vector> // vector for blocks namespace TNL { namespace Matrices { namespace Legacy { enum class Type { /* LONG = 0!!! Non zero value rewrites index[1] */ LONG = 0, STREAM = 1, VECTOR = 2 }; union Block { void set(uint32_t row, Type type = Type::VECTOR, uint32_t index = 0) noexcept { this->index[0] = row; this->index[1] = index; this->byte[7] = (uint8_t)type; } unsigned index[2]; // index[0] is row pointer, index[1] is index in warp uint8_t byte[8]; // byte[7] is type specificator }; #ifdef HAVE_UMFPACK template< typename Matrix, typename Preconditioner > class UmfpackWrapper; Loading Loading @@ -66,6 +85,10 @@ public: constexpr CSRKernel getSpMVKernelType() { return KernelType; }; //enum SPMVCudaKernel { scalar, vector, hybrid }; Containers::Vector< Block, Device, Index > blocks; Index maxElementsPerWarp = 1024; using Sparse< Real, Device, Index >::getAllocatedElementsCount; CSR(); Loading Loading @@ -229,6 +252,9 @@ public: const IndexType gridIdx ) const; #endif /* Analyze rowPointers, columnIndecies and values to create block for CSR Adaptive */ void setBlocks(); // The following getters allow us to interface TNL with external C-like // libraries such as UMFPACK or SuperLU, which need the raw data. const Containers::Vector< Index, Device, Index >& Loading src/TNL/Matrices/Legacy/CSR_impl.h +250 −196 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
src/TNL/Matrices/Legacy/CSR.h +26 −0 Original line number Diff line number Diff line Loading @@ -15,11 +15,30 @@ #include <TNL/Devices/Cuda.h> #include <TNL/Exceptions/CudaBadAlloc.h> #include <vector> // vector for blocks namespace TNL { namespace Matrices { namespace Legacy { enum class Type { /* LONG = 0!!! Non zero value rewrites index[1] */ LONG = 0, STREAM = 1, VECTOR = 2 }; union Block { void set(uint32_t row, Type type = Type::VECTOR, uint32_t index = 0) noexcept { this->index[0] = row; this->index[1] = index; this->byte[7] = (uint8_t)type; } unsigned index[2]; // index[0] is row pointer, index[1] is index in warp uint8_t byte[8]; // byte[7] is type specificator }; #ifdef HAVE_UMFPACK template< typename Matrix, typename Preconditioner > class UmfpackWrapper; Loading Loading @@ -66,6 +85,10 @@ public: constexpr CSRKernel getSpMVKernelType() { return KernelType; }; //enum SPMVCudaKernel { scalar, vector, hybrid }; Containers::Vector< Block, Device, Index > blocks; Index maxElementsPerWarp = 1024; using Sparse< Real, Device, Index >::getAllocatedElementsCount; CSR(); Loading Loading @@ -229,6 +252,9 @@ public: const IndexType gridIdx ) const; #endif /* Analyze rowPointers, columnIndecies and values to create block for CSR Adaptive */ void setBlocks(); // The following getters allow us to interface TNL with external C-like // libraries such as UMFPACK or SuperLU, which need the raw data. const Containers::Vector< Index, Device, Index >& Loading
src/TNL/Matrices/Legacy/CSR_impl.h +250 −196 File changed.Preview size limit exceeded, changes collapsed. Show changes