Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Conversation

@Xewar313
Copy link
Contributor

No description provided.

Copy link
Contributor

@lslusarczyk lslusarczyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, this is what we wanted

a few cosmetic comments below

b.push_back(i);
}

dr::mp::broadcasted_vector<double> broadcasted_b;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In lines 26-31 all ranks already computed their vector B

What is the step with "broadcasted_vector" for?

src/example7.cpp Outdated

std::vector<double> b;
b.reserve(matrix.shape().second);
std::vector<double> res(matrix.shape().first);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please move "res" declaration just before its first usage (calling gemv)

src/example7.cpp Outdated
std::vector<double> b;
b.reserve(matrix.shape().second);
std::vector<double> res(matrix.shape().first);
for (auto i = 0; i < matrix.shape().second; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use std::iota?

}
for (auto i = 0; i < nnz; i++) {
colInd[i] =
(i % 2) * (std::max(i / 2, 1)); // column on 0 and diagonal (with
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we draw that matrix in a comment?
something like this (not sure if this is your matrix shape, just an example)

// X X X ...     X
// 0 X 0 ...     0
// 0 0 X 0 ... 0
// 0 0 ...       X
dr::mp::csr_eq_distribution<V, I, dr::mp::MpiBackend>>
matrix(local_data, root);

std::vector<double> b;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comments an in the first example in this code

@lslusarczyk lslusarczyk reopened this Jan 20, 2025
@Xewar313 Xewar313 merged commit 1cd12dc into oneapi-src:main Jan 20, 2025
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants