From 32de29bda230b4e00abb9ef41e1caddf86f3e884 Mon Sep 17 00:00:00 2001 From: Pratik Nayak Date: Sat, 4 May 2024 08:54:44 +0200 Subject: [PATCH] getters need to be in headers due to circ dep issues, libginkgo -> libginkgo_kernels --- core/preconditioner/batch_jacobi.cpp | 51 ------------------- .../core/preconditioner/batch_jacobi.hpp | 32 +++++++++--- 2 files changed, 25 insertions(+), 58 deletions(-) diff --git a/core/preconditioner/batch_jacobi.cpp b/core/preconditioner/batch_jacobi.cpp index 927bc9c5be8..7d6ffa66848 100644 --- a/core/preconditioner/batch_jacobi.cpp +++ b/core/preconditioner/batch_jacobi.cpp @@ -42,57 +42,6 @@ size_type Jacobi::compute_storage_space( } -template -const IndexType* Jacobi::get_const_block_pointers() - const noexcept -{ - return block_pointers_.get_const_data(); -} - - -template -const IndexType* Jacobi::get_const_map_block_to_row() - const noexcept -{ - return map_block_to_row_.get_const_data(); -} - - -template -const IndexType* Jacobi< - ValueType, IndexType>::get_const_blocks_cumulative_offsets() const noexcept -{ - return blocks_cumulative_offsets_.get_const_data(); -} - - -template -uint32 Jacobi::get_max_block_size() const noexcept -{ - return parameters_.max_block_size; -} - - -template -size_type Jacobi::get_num_blocks() const noexcept -{ - return num_blocks_; -} - -template -const ValueType* Jacobi::get_const_blocks() const noexcept -{ - return blocks_.get_const_data(); -} - - -template -size_type Jacobi::get_num_stored_elements() const noexcept -{ - return blocks_.get_size(); -} - - template Jacobi::Jacobi(std::shared_ptr exec) : EnableBatchLinOp(exec), diff --git a/include/ginkgo/core/preconditioner/batch_jacobi.hpp b/include/ginkgo/core/preconditioner/batch_jacobi.hpp index ce89d793039..4aa0ca57b22 100644 --- a/include/ginkgo/core/preconditioner/batch_jacobi.hpp +++ b/include/ginkgo/core/preconditioner/batch_jacobi.hpp @@ -64,7 +64,10 @@ class Jacobi final : public EnableBatchLinOp> { * (max_block_size = 1). * @return the block pointers */ - const index_type* get_const_block_pointers() const noexcept; + const index_type* get_const_block_pointers() const noexcept + { + return block_pointers_.get_const_data(); + } /** * Returns the mapping between the blocks and the row id. @@ -72,7 +75,10 @@ class Jacobi final : public EnableBatchLinOp> { * @note Returns nullptr in case of a scalar jacobi preconditioner * (max_block_size = 1). */ - const index_type* get_const_map_block_to_row() const noexcept; + const index_type* get_const_map_block_to_row() const noexcept + { + return map_block_to_row_.get_const_data(); + } /** * Returns the cumulative blocks storage array @@ -80,21 +86,27 @@ class Jacobi final : public EnableBatchLinOp> { * @note Returns nullptr in case of a scalar jacobi preconditioner * (max_block_size = 1). */ - const index_type* get_const_blocks_cumulative_offsets() const noexcept; + const index_type* get_const_blocks_cumulative_offsets() const noexcept + { + return blocks_cumulative_offsets_.get_const_data(); + } /** * Returns the max block size. * * @return the max block size */ - uint32 get_max_block_size() const noexcept; + uint32 get_max_block_size() const noexcept + { + return parameters_.max_block_size; + } /** * Returns the number of blocks in an individual batch entry. * * @return the number of blocks in an individual batch entry. */ - size_type get_num_blocks() const noexcept; + size_type get_num_blocks() const noexcept { return num_blocks_; } /** * Returns the pointer to the memory used for storing the block data. @@ -114,7 +126,10 @@ class Jacobi final : public EnableBatchLinOp> { * * @return the pointer to the memory used for storing the block data */ - const value_type* get_const_blocks() const noexcept; + const value_type* get_const_blocks() const noexcept + { + return blocks_.get_const_data(); + } /** * Returns the number of elements explicitly stored in the dense blocks. @@ -125,7 +140,10 @@ class Jacobi final : public EnableBatchLinOp> { * * @return the number of elements explicitly stored in the dense blocks. */ - size_type get_num_stored_elements() const noexcept; + size_type get_num_stored_elements() const noexcept + { + return blocks_.get_size(); + } GKO_CREATE_FACTORY_PARAMETERS(parameters, Factory) {