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

Avoid scalar indexing with GPU arrays #40

Merged
merged 6 commits into from
Jan 28, 2022
Merged

Avoid scalar indexing with GPU arrays #40

merged 6 commits into from
Jan 28, 2022

Conversation

jipolanco
Copy link
Owner

@jipolanco jipolanco commented Jan 27, 2022

For GPU arrays, transpositions and other operations are now performed completely on the GPU (as far as I can tell...), avoiding slow scalar indexing.

Well, for now this has just been tested with the reference implementation of GPUArrays.jl (JLArray), which is implemented on CPUs.

It would be nice to test things with CuArrays. For that, one just needs to add CuArray to the list of array types tested in test/array_types.jl. @corentin-dev let me know if you can try that out.

For now I have no idea how the transposition of GPU arrays actually performs, and it would be nice to have some benchmarks. There are still some things that can be improved. In particular, when using dimension permutations (enabled by default in PencilFFTs), there are some additional allocations that should be taken care of.

This PR closes #21 (but can be reopened if stuff is missing).

@codecov-commenter
Copy link

codecov-commenter commented Jan 27, 2022

Codecov Report

Merging #40 (30474ed) into master (aaa806b) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #40      +/-   ##
==========================================
+ Coverage   97.15%   97.17%   +0.02%     
==========================================
  Files          17       18       +1     
  Lines         983     1026      +43     
==========================================
+ Hits          955      997      +42     
- Misses         28       29       +1     
Impacted Files Coverage Δ
src/Transpositions/Transpositions.jl 98.09% <100.00%> (+0.30%) ⬆️
src/gather.jl 100.00% <100.00%> (ø)
src/random.jl 100.00% <100.00%> (ø)
src/arrays.jl 95.14% <0.00%> (-0.98%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aaa806b...30474ed. Read the comment docs.

@jipolanco jipolanco marked this pull request as ready for review January 27, 2022 14:46
@jipolanco jipolanco merged commit 938cbb3 into master Jan 28, 2022
@jipolanco jipolanco deleted the gpu-indexing branch January 28, 2022 14:00
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.

PencilArrays + CUDA
2 participants