Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ create instances of `A` and `B` inside the `AB` kernel files. This is to avoid
the aforementioned circular dependency issue. An example for such a class is the
`Hybrid` matrix format, which uses the `apply()` of the `Ell` and `Coo` matrix
formats. Nevertheless, it is possible to call the kernels themselves directly
within the same executor. For example, `cuda::dense::add_scaled()` can be called
within the same executor. For example, `cuda::multivector::add_scaled()` can be called
from any other `cuda` kernel.

## Git related
Expand Down
34 changes: 19 additions & 15 deletions benchmark/blas/blas_common.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2017 - 2025 The Ginkgo authors
// SPDX-FileCopyrightText: 2017 - 2026 The Ginkgo authors
//
// SPDX-License-Identifier: BSD-3-Clause

Expand Down Expand Up @@ -106,7 +106,7 @@ class AxpyOperation : public BenchmarkOperation {
gko::size_type stride_out, bool multi)
{
auto size = gko::dim<2>{rows, cols};
alpha_ = gko::matrix::Dense<etype>::create(
alpha_ = gko::matrix::MultiVector<etype>::create(
exec, gko::dim<2>{1, multi ? cols : 1});
x_ = generator.create_multi_vector_strided(
exec, size, generator.create_default_local_size(size), stride_in);
Expand All @@ -131,7 +131,7 @@ class AxpyOperation : public BenchmarkOperation {
void run() override { as_vector<Generator>(y_)->add_scaled(alpha_, x_); }

private:
std::unique_ptr<gko::matrix::Dense<etype>> alpha_;
std::unique_ptr<gko::matrix::MultiVector<etype>> alpha_;
std::unique_ptr<gko::LinOp> x_;
std::unique_ptr<gko::LinOp> y_;
};
Expand All @@ -146,7 +146,7 @@ class SubScaledOperation : public BenchmarkOperation {
gko::size_type stride_out, bool multi)
{
auto size = gko::dim<2>{rows, cols};
alpha_ = gko::matrix::Dense<etype>::create(
alpha_ = gko::matrix::MultiVector<etype>::create(
exec, gko::dim<2>{1, multi ? cols : 1});
x_ = generator.create_multi_vector_strided(
exec, size, generator.create_default_local_size(size), stride_in);
Expand All @@ -171,7 +171,7 @@ class SubScaledOperation : public BenchmarkOperation {
void run() override { as_vector<Generator>(y_)->sub_scaled(alpha_, x_); }

private:
std::unique_ptr<gko::matrix::Dense<etype>> alpha_;
std::unique_ptr<gko::matrix::MultiVector<etype>> alpha_;
std::unique_ptr<gko::LinOp> x_;
std::unique_ptr<gko::LinOp> y_;
};
Expand All @@ -185,7 +185,7 @@ class ScalOperation : public BenchmarkOperation {
gko::size_type cols, gko::size_type stride, bool multi)
{
auto size = gko::dim<2>{rows, cols};
alpha_ = gko::matrix::Dense<etype>::create(
alpha_ = gko::matrix::MultiVector<etype>::create(
exec, gko::dim<2>{1, multi ? cols : 1});
y_ = generator.create_multi_vector_strided(
exec, size, generator.create_default_local_size(size), stride);
Expand All @@ -207,7 +207,7 @@ class ScalOperation : public BenchmarkOperation {
void run() override { as_vector<Generator>(y_)->scale(alpha_); }

private:
std::unique_ptr<gko::matrix::Dense<etype>> alpha_;
std::unique_ptr<gko::matrix::MultiVector<etype>> alpha_;
std::unique_ptr<gko::LinOp> y_;
};

Expand All @@ -221,7 +221,8 @@ class DotOperation : public BenchmarkOperation {
gko::size_type stride_y)
{
auto size = gko::dim<2>{rows, cols};
alpha_ = gko::matrix::Dense<etype>::create(exec, gko::dim<2>{1, cols});
alpha_ =
gko::matrix::MultiVector<etype>::create(exec, gko::dim<2>{1, cols});
x_ = generator.create_multi_vector_strided(
exec, size, generator.create_default_local_size(size), stride_x);
y_ = generator.create_multi_vector_strided(
Expand All @@ -243,7 +244,7 @@ class DotOperation : public BenchmarkOperation {
void run() override { as_vector<Generator>(x_)->compute_dot(y_, alpha_); }

private:
std::unique_ptr<gko::matrix::Dense<etype>> alpha_;
std::unique_ptr<gko::matrix::MultiVector<etype>> alpha_;
std::unique_ptr<gko::LinOp> x_;
std::unique_ptr<gko::LinOp> y_;
};
Expand All @@ -257,7 +258,8 @@ class NormOperation : public BenchmarkOperation {
gko::size_type cols, gko::size_type stride)
{
auto size = gko::dim<2>{rows, cols};
alpha_ = gko::matrix::Dense<etype>::create(exec, gko::dim<2>{1, cols});
alpha_ =
gko::matrix::MultiVector<etype>::create(exec, gko::dim<2>{1, cols});
y_ = generator.create_multi_vector_strided(
exec, size, generator.create_default_local_size(size), stride);
as_vector<Generator>(y_)->fill(1);
Expand All @@ -276,7 +278,7 @@ class NormOperation : public BenchmarkOperation {
void run() override { as_vector<Generator>(y_)->compute_norm2(alpha_); }

private:
std::unique_ptr<gko::matrix::Dense<etype>> alpha_;
std::unique_ptr<gko::matrix::MultiVector<etype>> alpha_;
std::unique_ptr<gko::LinOp> y_;
};

Expand Down Expand Up @@ -340,8 +342,10 @@ class AdvancedApplyOperation : public BenchmarkOperation {
gko::dim<2>{k, m}, stride_B);
C_ = generator.create_multi_vector_strided(exec, gko::dim<2>{n, m},
gko::dim<2>{n, m}, stride_C);
alpha_ = gko::matrix::Dense<etype>::create(exec, gko::dim<2>{1, 1});
beta_ = gko::matrix::Dense<etype>::create(exec, gko::dim<2>{1, 1});
alpha_ =
gko::matrix::MultiVector<etype>::create(exec, gko::dim<2>{1, 1});
beta_ =
gko::matrix::MultiVector<etype>::create(exec, gko::dim<2>{1, 1});
as_vector<Generator>(A_)->fill(1);
as_vector<Generator>(B_)->fill(1);
alpha_->fill(1);
Expand All @@ -365,8 +369,8 @@ class AdvancedApplyOperation : public BenchmarkOperation {
void run() override { A_->apply(alpha_, B_, beta_, C_); }

private:
std::unique_ptr<gko::matrix::Dense<etype>> alpha_;
std::unique_ptr<gko::matrix::Dense<etype>> beta_;
std::unique_ptr<gko::matrix::MultiVector<etype>> alpha_;
std::unique_ptr<gko::matrix::MultiVector<etype>> beta_;
std::unique_ptr<gko::LinOp> A_;
std::unique_ptr<gko::LinOp> B_;
std::unique_ptr<gko::LinOp> C_;
Expand Down
11 changes: 6 additions & 5 deletions benchmark/sparse_blas/operations.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2017 - 2025 The Ginkgo authors
// SPDX-FileCopyrightText: 2017 - 2026 The Ginkgo authors
//
// SPDX-License-Identifier: BSD-3-Clause

Expand Down Expand Up @@ -243,7 +243,7 @@ class SpgeamOperation : public BenchmarkOperation {
}
mtx2_ = gko::as<Mtx>(mtx_->row_permute(&permutation_array));
id_ = gko::matrix::Identity<etype>::create(exec, size[1]);
scalar_ = gko::initialize<gko::matrix::Dense<etype>>({1.0}, exec);
scalar_ = gko::initialize<gko::matrix::MultiVector<etype>>({1.0}, exec);
}

std::pair<bool, double> validate() const override
Expand Down Expand Up @@ -277,7 +277,7 @@ class SpgeamOperation : public BenchmarkOperation {
private:
const Mtx* mtx_;
std::unique_ptr<Mtx> mtx2_;
std::unique_ptr<gko::matrix::Dense<etype>> scalar_;
std::unique_ptr<gko::matrix::MultiVector<etype>> scalar_;
std::unique_ptr<gko::matrix::Identity<etype>> id_;
std::unique_ptr<Mtx> mtx_out_;
};
Expand Down Expand Up @@ -654,8 +654,9 @@ class SymbolicCholeskyOperation : public BenchmarkOperation {
const auto exec = mtx_->get_executor();
const auto symm_result = result_->clone();
const auto lt_factor = gko::as<Mtx>(symm_result->transpose());
const auto scalar = gko::initialize<gko::matrix::Dense<etype>>(
{gko::one<etype>()}, exec);
const auto scalar =
gko::initialize<gko::matrix::MultiVector<etype>>(
{gko::one<etype>()}, exec);
const auto id =
gko::matrix::Identity<etype>::create(exec, mtx_->get_size()[0]);
lt_factor->apply(scalar, id, scalar, symm_result);
Expand Down
42 changes: 21 additions & 21 deletions benchmark/test/reference/blas.profile.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,39 @@ Running on ReferenceExecutor
Running with 0 warm iterations and 1 running iterations
The random seed for right hand sides is 42
The operations are copy,axpy,scal
Running test case n = 100
DEBUG: begin n = 100
Running test case n = 100
DEBUG: begin n = 100
Running blas: copy
DEBUG: begin copy
DEBUG: begin dense::fill
DEBUG: end dense::fill
DEBUG: begin multivector::fill
DEBUG: end multivector::fill
DEBUG: begin repetition
DEBUG: begin dense::copy
DEBUG: end dense::copy
DEBUG: begin multivector::copy
DEBUG: end multivector::copy
DEBUG: end repetition
DEBUG: end copy
Running blas: axpy
DEBUG: begin axpy
DEBUG: begin dense::fill
DEBUG: end dense::fill
DEBUG: begin dense::fill
DEBUG: end dense::fill
DEBUG: begin dense::fill
DEBUG: end dense::fill
DEBUG: begin multivector::fill
DEBUG: end multivector::fill
DEBUG: begin multivector::fill
DEBUG: end multivector::fill
DEBUG: begin multivector::fill
DEBUG: end multivector::fill
DEBUG: begin repetition
DEBUG: begin dense::add_scaled
DEBUG: end dense::add_scaled
DEBUG: begin multivector::add_scaled
DEBUG: end multivector::add_scaled
DEBUG: end repetition
DEBUG: end axpy
Running blas: scal
DEBUG: begin scal
DEBUG: begin dense::fill
DEBUG: end dense::fill
DEBUG: begin dense::fill
DEBUG: end dense::fill
DEBUG: begin multivector::fill
DEBUG: end multivector::fill
DEBUG: begin multivector::fill
DEBUG: end multivector::fill
DEBUG: begin repetition
DEBUG: begin dense::scale
DEBUG: end dense::scale
DEBUG: begin multivector::scale
DEBUG: end multivector::scale
DEBUG: end repetition
DEBUG: end scal
DEBUG: end n = 100
DEBUG: end n = 100
12 changes: 6 additions & 6 deletions benchmark/test/reference/distributed_solver.matrix.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@
"apply(<typename>)": 1.0,
"iteration": 1.0,
"allocate": 1.0,
"dense::fill": 1.0,
"multivector::fill": 1.0,
"cg::initialize": 1.0,
"advanced_apply(<typename>)": 1.0,
"dense::row_gather": 1.0,
"multivector::row_gather": 1.0,
"event::record_event": 1.0,
"csr::advanced_spmv": 1.0,
"dense::compute_squared_norm2": 1.0,
"dense::compute_sqrt": 1.0,
"multivector::compute_squared_norm2": 1.0,
"multivector::compute_sqrt": 1.0,
"copy(<typename>)": 1.0,
"dense::copy": 1.0,
"dense::compute_conj_dot_dispatch": 1.0,
"multivector::copy": 1.0,
"multivector::compute_conj_dot_dispatch": 1.0,
"check(<typename>)": 1.0,
"residual_norm::residual_norm": 1.0,
"cg::step_1": 1.0,
Expand Down
Loading
Loading