diff --git a/src/TNL/Matrices/SparseRow.h b/src/TNL/Matrices/SparseRow.h
index 94513625414d24e116e298dddecda905f05900b2..e7547ee679e89cef5e2c607720d13d538ba3c31a 100644
--- a/src/TNL/Matrices/SparseRow.h
+++ b/src/TNL/Matrices/SparseRow.h
@@ -49,6 +49,9 @@ class SparseRow
       __cuda_callable__
       const Real& getElementValue( const Index& elementIndex ) const;
 
+      __cuda_callable__
+      Index getLength() const;
+
       void print( std::ostream& str ) const;
 
    protected:
diff --git a/src/TNL/Matrices/SparseRow_impl.h b/src/TNL/Matrices/SparseRow_impl.h
index c4b69044bcd27268b3e6df8b53ab71ab379c9349..f6921b15bbf8f282f0dee1a2f6c842a230cf0dd3 100644
--- a/src/TNL/Matrices/SparseRow_impl.h
+++ b/src/TNL/Matrices/SparseRow_impl.h
@@ -98,6 +98,15 @@ getElementValue( const Index& elementIndex ) const
    return this->values[ elementIndex * step ];
 }
 
+template< typename Real, typename Index >
+__cuda_callable__
+Index
+SparseRow< Real, Index >::
+getLength() const
+{
+   return length;
+}
+
 template< typename Real, typename Index >
 void
 SparseRow< Real, Index >::