Skip to content

Commit

Permalink
review updates
Browse files Browse the repository at this point in the history
Co-authored-by: Yu-Hsiang Tsai <[email protected]>
  • Loading branch information
pratikvn and yhmtsai committed May 15, 2024
1 parent 99990ce commit 82c69d1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/base/workspace_aliases.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace detail {
template <int num_allocs, int align_bytes = 8>
GKO_ATTRIBUTES GKO_INLINE GKO_DEVICE_ERROR_TYPE create_workspace_aliases(
void* workspace_ptr, size_t& num_bytes, void* (&allocations)[num_allocs],
size_t (&allocation_sizes)[num_allocs])
const size_t (&allocation_sizes)[num_allocs])
{
constexpr int align_mask = ~(align_bytes - 1);

Expand Down
3 changes: 3 additions & 0 deletions core/log/batch_logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ log_data<ValueType>::log_data(std::shared_ptr<const Executor> exec,
array<unsigned char>& workspace)
: res_norms(exec), iter_counts(exec)
{
// it should at least `num * (sizeof(real_type) + sizeof(int))` with some
// additional buffer for alias purpose, but we simply request a large enough
// size here.
const size_type reqd_workspace_size = num_batch_items * 32;

if (num_batch_items > 0 && !workspace.is_owning() &&
Expand Down
3 changes: 3 additions & 0 deletions include/ginkgo/core/solver/batch_solver_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ class EnableBatchSolver
auto id = Identity::create(exec, system_matrix->get_size());
preconditioner_ = std::move(id);
}
// We use a workspace here to store the logger data (iteration count
// and solver residual), and require a minimum size of
// `sizeof(real_type)+ sizeof(int)`
const size_type workspace_size =
system_matrix->get_num_batch_items() * 32;
workspace_.set_executor(exec);
Expand Down

0 comments on commit 82c69d1

Please sign in to comment.