This repository was archived by the owner on Nov 24, 2025. It is now read-only.
Add sparse matrix usage to example#13
Merged
Xewar313 merged 8 commits intooneapi-src:mainfrom Jan 20, 2025
Merged
Conversation
lslusarczyk
reviewed
Jan 20, 2025
Contributor
lslusarczyk
left a comment
There was a problem hiding this comment.
great, this is what we wanted
a few cosmetic comments below
| b.push_back(i); | ||
| } | ||
|
|
||
| dr::mp::broadcasted_vector<double> broadcasted_b; |
Contributor
There was a problem hiding this comment.
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); |
Contributor
There was a problem hiding this comment.
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++) { |
| } | ||
| for (auto i = 0; i < nnz; i++) { | ||
| colInd[i] = | ||
| (i % 2) * (std::max(i / 2, 1)); // column on 0 and diagonal (with |
Contributor
There was a problem hiding this comment.
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; |
Contributor
There was a problem hiding this comment.
same comments an in the first example in this code
added 2 commits
January 20, 2025 10:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.