Skip to content

Commit

Permalink
getters need to be in headers
Browse files Browse the repository at this point in the history
due to circ dep issues, libginkgo -> libginkgo_kernels
  • Loading branch information
pratikvn committed May 4, 2024
1 parent 8ffcf0d commit 32de29b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 58 deletions.
51 changes: 0 additions & 51 deletions core/preconditioner/batch_jacobi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,57 +42,6 @@ size_type Jacobi<ValueType, IndexType>::compute_storage_space(
}


template <typename ValueType, typename IndexType>
const IndexType* Jacobi<ValueType, IndexType>::get_const_block_pointers()
const noexcept
{
return block_pointers_.get_const_data();
}


template <typename ValueType, typename IndexType>
const IndexType* Jacobi<ValueType, IndexType>::get_const_map_block_to_row()
const noexcept
{
return map_block_to_row_.get_const_data();
}


template <typename ValueType, typename IndexType>
const IndexType* Jacobi<
ValueType, IndexType>::get_const_blocks_cumulative_offsets() const noexcept
{
return blocks_cumulative_offsets_.get_const_data();
}


template <typename ValueType, typename IndexType>
uint32 Jacobi<ValueType, IndexType>::get_max_block_size() const noexcept
{
return parameters_.max_block_size;
}


template <typename ValueType, typename IndexType>
size_type Jacobi<ValueType, IndexType>::get_num_blocks() const noexcept
{
return num_blocks_;
}

template <typename ValueType, typename IndexType>
const ValueType* Jacobi<ValueType, IndexType>::get_const_blocks() const noexcept
{
return blocks_.get_const_data();
}


template <typename ValueType, typename IndexType>
size_type Jacobi<ValueType, IndexType>::get_num_stored_elements() const noexcept
{
return blocks_.get_size();
}


template <typename ValueType, typename IndexType>
Jacobi<ValueType, IndexType>::Jacobi(std::shared_ptr<const Executor> exec)
: EnableBatchLinOp<Jacobi>(exec),
Expand Down
32 changes: 25 additions & 7 deletions include/ginkgo/core/preconditioner/batch_jacobi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,37 +64,49 @@ class Jacobi final : public EnableBatchLinOp<Jacobi<ValueType, IndexType>> {
* (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.
*
* @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
*
* @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.
Expand All @@ -114,7 +126,10 @@ class Jacobi final : public EnableBatchLinOp<Jacobi<ValueType, IndexType>> {
*
* @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.
Expand All @@ -125,7 +140,10 @@ class Jacobi final : public EnableBatchLinOp<Jacobi<ValueType, IndexType>> {
*
* @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)
{
Expand Down

0 comments on commit 32de29b

Please sign in to comment.