-
-
Notifications
You must be signed in to change notification settings - Fork 47
Add a GPU tutorial #589
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
Add a GPU tutorial #589
Conversation
In this tutorial we will highlight both use cases in separate parts. | ||
|
||
!!! note | ||
|
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.
[JuliaFormatter] reported by reviewdog 🐶
u0 = cu(ones(1000)) | ||
p = cu(collect(1:1000)) | ||
prob = NonlinearProblem(f, u0, p) | ||
sol = solve(prob, NewtonRaphson(), abstol=1f-4) |
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.
[JuliaFormatter] reported by reviewdog 🐶
sol = solve(prob, NewtonRaphson(), abstol=1f-4) | |
sol = solve(prob, NewtonRaphson(), abstol = 1.0f-4) |
The ith result is then this solution". | ||
|
||
!!! note | ||
|
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.
[JuliaFormatter] reported by reviewdog 🐶
out2 = sqrt(p[2]) * (x[3] - x[4]) | ||
out3 = (x[2] - p[3] * x[3])^2 | ||
out4 = sqrt(p[4]) * (x[1] - x[4]) * (x[1] - x[4]) | ||
SA[out1,out2,out3,out4] |
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.
[JuliaFormatter] reported by reviewdog 🐶
SA[out1,out2,out3,out4] | |
SA[out1, out2, out3, out4] |
end | ||
|
||
p = @SVector [@SVector(rand(Float32, 4)) for _ in 1:1024] | ||
u0 = SA[1f0, 2f0, 3f0, 4f0] |
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.
[JuliaFormatter] reported by reviewdog 🐶
u0 = SA[1f0, 2f0, 3f0, 4f0] | |
u0 = SA[1.0f0, 2.0f0, 3.0f0, 4.0f0] |
``` | ||
|
||
!!! note | ||
|
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.
[JuliaFormatter] reported by reviewdog 🐶
``` | ||
|
||
!!! warn | ||
The GPU-based calls will only work on your machine if you have a compatible GPU! |
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.
[JuliaFormatter] reported by reviewdog 🐶
The GPU-based calls will only work on your machine if you have a compatible GPU! | |
The GPU-based calls will only work on your machine if you have a compatible GPU! |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Fixes #405 (comment)