- Notifications
You must be signed in to change notification settings - Fork5
Add sparse matrix usage to example#13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
lslusarczyk left a comment
There was a problem hiding this 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; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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++) { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
1cd12dc intooneapi-src:mainUh oh!
There was an error while loading.Please reload this page.
No description provided.