Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
Xewar313 merged 8 commits intooneapi-src:mainfromXewar313:sparse-example
Jan 20, 2025

Conversation

@Xewar313
Copy link
Contributor

No description provided.

Copy link
Contributor

@lslusarczyklslusarczyk 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?


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)

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

@Xewar313Xewar313 merged commit1cd12dc intooneapi-src:mainJan 20, 2025
2 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@lslusarczyklslusarczyklslusarczyk left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@Xewar313@lslusarczyk

[8]ページ先頭

©2009-2025 Movatter.jp