Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Benchmark] conjugate gradients #261

Merged
merged 3 commits into from
Aug 30, 2023
Merged

[Benchmark] conjugate gradients #261

merged 3 commits into from
Aug 30, 2023

Conversation

willwng
Copy link
Contributor

@willwng willwng commented Aug 29, 2023

A bril benchmark for using conjugate gradients to solve Ax=b. Currently the file takes in n, which is the size of the matrix and A is diagonal with incrementing values. However, the code implements dense matrix multiplication and can support any arbitrary A (it is somewhat tricky to randomly generate spd matrices).

fyi: the vim syntax highlighting also sometimes stopped working when functions had a specified return type

@sampsyo
Copy link
Owner

sampsyo commented Aug 30, 2023

Really cool; nice work!

There is a minor conflict on the docs page; could you please resolve that so we can merge?

@sampsyo
Copy link
Owner

sampsyo commented Aug 30, 2023

Thanks!! Now that the CI has run, it has also revealed that the benchmark has a few type errors. (You can run the type checker yourself if you want.) In particular, it looks like some places there is a ptr<int> where it should probably be a ptr<float>.

@willwng
Copy link
Contributor Author

willwng commented Aug 30, 2023

Thanks!! Now that the CI has run, it has also revealed that the benchmark has a few type errors. (You can run the type checker yourself if you want.) In particular, it looks like some places there is a ptr<int> where it should probably be a ptr<float>.

Oops, didn't realize there was a type checker! The github workflow integration is really neat. I think I fixed the type errors and added an input for the size of the matrix.

@sampsyo
Copy link
Owner

sampsyo commented Aug 30, 2023

Looks great; thanks!

@sampsyo sampsyo merged commit 61db389 into sampsyo:main Aug 30, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants