diff --git a/src/TNL/Matrices/Ellpack_impl.h b/src/TNL/Matrices/Ellpack_impl.h index f3c05c492d8e269834b523436e79fd25edab2d0f..5e757efb969d997390e4eefd31061b93c7274f49 100644 --- a/src/TNL/Matrices/Ellpack_impl.h +++ b/src/TNL/Matrices/Ellpack_impl.h @@ -75,7 +75,7 @@ void Ellpack< Real, Device, Index >::setDimensions( const IndexType rows, this->rows = rows; this->columns = columns; if( std::is_same< Device, Devices::Cuda >::value ) - this->alignedRows = roundToMultiple( columns, Devices::Cuda::getWarpSize() ); + this->alignedRows = roundToMultiple( rows, Devices::Cuda::getWarpSize() ); else this->alignedRows = rows; if( this->rowLengths != 0 ) allocateElements(); @@ -142,7 +142,9 @@ void Ellpack< Real, Device, Index >::setLike( const Ellpack< Real2, Device2, Ind { Sparse< Real, Device, Index >::setLike( matrix ); this->rowLengths = matrix.rowLengths; - this->alignedRows = matrix.alignedRows; + if( std::is_same< Device, Devices::Cuda >::value ) + this->alignedRows = roundToMultiple( this->getRows(), Devices::Cuda::getWarpSize() ); + else this->alignedRows = this->getRows(); } template< typename Real,