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

Add extension package for StaticArrays #2273

Merged
merged 6 commits into from
Feb 28, 2024
Merged

Add extension package for StaticArrays #2273

merged 6 commits into from
Feb 28, 2024

Conversation

trahflow
Copy link
Contributor

@trahflow trahflow commented Feb 22, 2024

The motivation for this PR is to @device_override a particular throw-method in StaticArrays to make it GPU-compatible.
This is done like in src/device/quirks.jl, but placed in a new extension package for StaticArrays as suggested by @maleadt here.

@maleadt do I understand you right that the idea is to also make KernelAbstractions a weak dependency? This would have to be done as part of this PR then I guess? Otherwise I'm unsure how having StaticArrays as both, a direct dependency (due to the fact it's used in the KA backend code) and an extension package (as introduced here) would work out.
For now I'm directly including the code, albeit it still lives in ext/.

The test (actual test and the file layout) is just a suggestion. I'm not familiar with CUDA.jl's test setup, and I always have a bit of an issue with code loading when dev-installing a package that has extension packages.

test/ext/staticarrays.jl Outdated Show resolved Hide resolved
@trahflow trahflow marked this pull request as ready for review February 26, 2024 08:24
@maleadt
Copy link
Member

maleadt commented Feb 27, 2024

Thanks for the PR!

@maleadt do I understand you right that the idea is to also make KernelAbstractions a weak dependency?

KernelAbstractions.jl can remain a normal dependency, as that would be a much more invasive change. I'm hoping to get rid of the StaticArrays dep, which wouldn't necessarily demote KA.jl to a weak dep.

test/ext/staticarrays.jl Outdated Show resolved Hide resolved
@trahflow
Copy link
Contributor Author

Thanks for the review!

I've moved the test and improved the error message a bit (mentioning conversion to StaticArray).

@maleadt maleadt merged commit 6a58662 into JuliaGPU:master Feb 28, 2024
1 check passed
@trahflow trahflow deleted the StaticArraysExt branch February 28, 2024 12:55
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.

None yet

2 participants