diff --git a/core/matrix/batch_struct.hpp b/core/matrix/batch_struct.hpp index aa48281b3d5..558789ba99f 100644 --- a/core/matrix/batch_struct.hpp +++ b/core/matrix/batch_struct.hpp @@ -32,6 +32,11 @@ struct batch_item { const index_type* row_ptrs; index_type num_rows; index_type num_cols; + + inline size_type get_single_item_num_nnz() const + { + return static_cast(num_nnz_per_item); + } }; @@ -75,6 +80,11 @@ struct batch_item { int32 stride; int32 num_rows; int32 num_cols; + + inline size_type get_single_item_num_nnz() const + { + return static_cast(stride * num_rows); + } }; @@ -119,6 +129,11 @@ struct batch_item { index_type num_rows; index_type num_cols; index_type num_stored_elems_per_row; + + inline size_type get_single_item_num_nnz() const + { + return static_cast(stride * num_stored_elems_per_row); + } }; diff --git a/core/preconditioner/batch_jacobi.cpp b/core/preconditioner/batch_jacobi.cpp index 233062e4bd0..57a41bbf100 100644 --- a/core/preconditioner/batch_jacobi.cpp +++ b/core/preconditioner/batch_jacobi.cpp @@ -105,7 +105,7 @@ void Jacobi::generate_precond( num_blocks_, parameters_.block_pointers.get_const_data(), row_part_of_which_block_info_.get_data())); - // Note: Row-major order offers advanatge in terms of + // Note: Row-major order offers advantage in terms of // performance in both preconditioner generation and application for both // reference and cuda backend. Note: The pattern blocks in block_pattern are // also stored in a similar way. diff --git a/include/ginkgo/core/preconditioner/batch_jacobi.hpp b/include/ginkgo/core/preconditioner/batch_jacobi.hpp index de0da878c25..c827e1301bd 100644 --- a/include/ginkgo/core/preconditioner/batch_jacobi.hpp +++ b/include/ginkgo/core/preconditioner/batch_jacobi.hpp @@ -324,7 +324,7 @@ class Jacobi : public EnableBatchLinOp> { /** * Creates a Jacobi preconditioner from a matrix using a Jacobi::Factory. * - * @param factory the factory to use to create the preconditoner + * @param factory the factory to use to create the preconditioner * @param system_matrix the matrix this preconditioner should be created * from */ @@ -348,7 +348,7 @@ class Jacobi : public EnableBatchLinOp> { } /** - * Generates the preconditoner. + * Generates the preconditioner. * */ void generate_precond(const BatchLinOp* const system_matrix);