Skip to content

Commit

Permalink
fix typos and add batch_item nnz getter
Browse files Browse the repository at this point in the history
  • Loading branch information
pratikvn committed Feb 14, 2024
1 parent 6e0985e commit 6d06c91
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
15 changes: 15 additions & 0 deletions core/matrix/batch_struct.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<size_type>(num_nnz_per_item);
}
};


Expand Down Expand Up @@ -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<size_type>(stride * num_rows);
}
};


Expand Down Expand Up @@ -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<size_type>(stride * num_stored_elems_per_row);
}
};


Expand Down
2 changes: 1 addition & 1 deletion core/preconditioner/batch_jacobi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void Jacobi<ValueType, IndexType>::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.
Expand Down
4 changes: 2 additions & 2 deletions include/ginkgo/core/preconditioner/batch_jacobi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ class Jacobi : public EnableBatchLinOp<Jacobi<ValueType, IndexType>> {
/**
* 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
*/
Expand All @@ -348,7 +348,7 @@ class Jacobi : public EnableBatchLinOp<Jacobi<ValueType, IndexType>> {
}

/**
* Generates the preconditoner.
* Generates the preconditioner.
*
*/
void generate_precond(const BatchLinOp* const system_matrix);
Expand Down

0 comments on commit 6d06c91

Please sign in to comment.