Skip to content

Commit 0c3627f

Browse files
committed
compilation fixes
- assertions weren't compiled before - MPI was missing from refactor compile_commands.json
1 parent a54e019 commit 0c3627f

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

core/distributed/vector.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2017 - 2025 The Ginkgo authors
1+
// SPDX-FileCopyrightText: 2017 - 2026 The Ginkgo authors
22
//
33
// SPDX-License-Identifier: BSD-3-Clause
44

@@ -204,7 +204,8 @@ void Vector<ValueType>::read_distributed_impl(
204204
auto rank = this->get_communicator().rank();
205205
local_.fill(zero<ValueType>());
206206
exec->run(vector::make_build_local(
207-
data, make_temporary_clone(exec, partition).get(), rank, &local_));
207+
data, make_temporary_clone(exec, partition).get(), rank,
208+
local_.get_device_view()));
208209
}
209210

210211

@@ -345,8 +346,9 @@ Vector<ValueType>::compute_absolute() const
345346
absolute_type::create(exec, this->get_communicator(), this->get_size(),
346347
this->get_local_vector()->get_size());
347348

348-
exec->run(vector::make_outplace_absolute_dense(this->get_local_vector(),
349-
&result->local_));
349+
exec->run(vector::make_outplace_absolute_dense(
350+
this->get_local_vector()->get_const_device_view(),
351+
result->local_.get_device_view()));
350352

351353
return result;
352354
}
@@ -551,7 +553,7 @@ void Vector<ValueType>::compute_norm2(ptr_param<LinOp> result,
551553
const auto comm = this->get_communicator();
552554
auto dense_res = make_temporary_clone(exec, as<NormVector>(result));
553555
this->compute_squared_norm2(dense_res.get(), tmp);
554-
exec->run(vector::make_compute_sqrt(dense_res.get()));
556+
exec->run(vector::make_compute_sqrt(dense_res->get_device_view()));
555557
}
556558

557559

@@ -607,8 +609,9 @@ void Vector<ValueType>::compute_squared_norm2(ptr_param<LinOp> result,
607609
auto exec = this->get_executor();
608610
const auto comm = this->get_communicator();
609611
auto dense_res = make_temporary_clone(exec, as<NormVector>(result));
610-
exec->run(vector::make_compute_squared_norm2(this->get_local_vector(),
611-
dense_res.get(), tmp));
612+
exec->run(vector::make_compute_squared_norm2(
613+
this->get_local_vector()->get_const_device_view(),
614+
dense_res->get_device_view(), tmp));
612615
exec->synchronize();
613616
auto norm_sum_op = gko::experimental::mpi::sum<remove_complex<ValueType>>();
614617
if (mpi::requires_host_buffer(exec, comm)) {

omp/matrix/coo_kernels.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ void spmv2_blocked(std::shared_ptr<const OmpExecutor> exec,
6868
matrix::view::dense<const ValueType> b,
6969
matrix::view::dense<ValueType> c, ValueType scale)
7070
{
71-
GKO_ASSERT(b->get_size()[1] > block_size);
71+
GKO_ASSERT(b.size[1] > block_size);
7272
const auto coo_val = a->get_const_values();
7373
const auto coo_col = a->get_const_col_idxs();
7474
const auto coo_row = a->get_const_row_idxs();
@@ -198,7 +198,7 @@ void spmv2_small_rhs(std::shared_ptr<const OmpExecutor> exec,
198198
matrix::view::dense<const ValueType> b,
199199
matrix::view::dense<ValueType> c, ValueType scale)
200200
{
201-
GKO_ASSERT(b->get_size()[1] == num_rhs);
201+
GKO_ASSERT(b.size[1] == num_rhs);
202202
const auto coo_val = a->get_const_values();
203203
const auto coo_col = a->get_const_col_idxs();
204204
const auto coo_row = a->get_const_row_idxs();

omp/matrix/ell_kernels.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2017 - 2025 The Ginkgo authors
1+
// SPDX-FileCopyrightText: 2017 - 2026 The Ginkgo authors
22
//
33
// SPDX-License-Identifier: BSD-3-Clause
44

@@ -35,7 +35,7 @@ void spmv_small_rhs(std::shared_ptr<const OmpExecutor> exec,
3535
matrix::view::dense<const InputValueType> b,
3636
matrix::view::dense<OutputValueType> c, OutFn out)
3737
{
38-
GKO_ASSERT(b->get_size()[1] == num_rhs);
38+
GKO_ASSERT(b.size[1] == num_rhs);
3939
using arithmetic_type =
4040
highest_precision<InputValueType, OutputValueType, MatrixValueType>;
4141
using a_accessor =
@@ -85,7 +85,7 @@ void spmv_blocked(std::shared_ptr<const OmpExecutor> exec,
8585
matrix::view::dense<const InputValueType> b,
8686
matrix::view::dense<OutputValueType> c, OutFn out)
8787
{
88-
GKO_ASSERT(b->get_size()[1] > block_size);
88+
GKO_ASSERT(b.size[1] > block_size);
8989
using arithmetic_type =
9090
highest_precision<InputValueType, OutputValueType, MatrixValueType>;
9191
using a_accessor =

omp/matrix/sellp_kernels.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2017 - 2025 The Ginkgo authors
1+
// SPDX-FileCopyrightText: 2017 - 2026 The Ginkgo authors
22
//
33
// SPDX-License-Identifier: BSD-3-Clause
44

@@ -28,7 +28,7 @@ void spmv_small_rhs(std::shared_ptr<const OmpExecutor> exec,
2828
matrix::view::dense<const ValueType> b,
2929
matrix::view::dense<ValueType> c, OutFn out)
3030
{
31-
GKO_ASSERT(b->get_size()[1] == num_rhs);
31+
GKO_ASSERT(b.size[1] == num_rhs);
3232
auto slice_lengths = a->get_const_slice_lengths();
3333
auto slice_sets = a->get_const_slice_sets();
3434
auto slice_size = a->get_slice_size();

0 commit comments

Comments
 (0)