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.
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
Added support for CuArray via Adapt.jl #67
base: master
Are you sure you want to change the base?
Added support for CuArray via Adapt.jl #67
Changes from 1 commit
aec3bf2
dee9144
2f751c0
6fc77cd
52a28d1
ec23e5a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 9 in ext/CUDASupportExt.jl
Codecov / codecov/patch
ext/CUDASupportExt.jl#L7-L9
Check warning on line 12 in ext/CUDASupportExt.jl
Codecov / codecov/patch
ext/CUDASupportExt.jl#L12
Check warning on line 16 in ext/CUDASupportExt.jl
Codecov / codecov/patch
ext/CUDASupportExt.jl#L15-L16
Check warning on line 20 in ext/CUDASupportExt.jl
Codecov / codecov/patch
ext/CUDASupportExt.jl#L19-L20
Check warning on line 24 in ext/CUDASupportExt.jl
Codecov / codecov/patch
ext/CUDASupportExt.jl#L23-L24
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.
This part makes me a little uncomfortable (it's type-piracy in some sense), maybe it's best to remove it for the time being and accept that showing errors and we can see how to fix it later. How do other wrapping packages do it? Should we maybe just depend on GPUArraysCore and take
@allowscalar
from there?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.
I agree. I will commend this out for the time being and test your other great suggestions,
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.
Maybe we could use https://github.com/JuliaGPU/GPUArrays.jl/blob/4278412a6b9b1d859c290232a9f8223eb4416d1e/lib/JLArrays/src/JLArrays.jl#L6 to test without a GPU? Also, maybe we can try and use
@allowscalar
to selectively allow scalar indexing where it's needed.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.
I did not want CUDA to be a dependency on testing, if we move
@allowscalar
outside the if clause, we would need to always have CUDA loaded for testing. IfJLArrays.jl
is a lightweight way of doing this, then this may be a good idea.