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

Make CUDA an extension #1687

Merged
merged 3 commits into from
Apr 24, 2024
Merged

Make CUDA an extension #1687

merged 3 commits into from
Apr 24, 2024

Conversation

charleskawczynski
Copy link
Member

@charleskawczynski charleskawczynski commented Apr 22, 2024

This PR makes CUDA an extension.

This should allow us to more easily test on newer versions, if cuda is a bit late to catching up. Also, it should help with code loading times when we're only running on the cpu.

Closes: #1667

@charleskawczynski
Copy link
Member Author

A couple quarks I applied are, so that we can overload them with cuda:

  • cuda_synchronize(device::ClimaComms.AbstractDevice; kwargs...) = nothing
  • allow_scalar_func(::ClimaComms.AbstractDevice, f, args) = f(args...) & allow_scalar_func(::ClimaComms.CUDADevice, f, args) = CUDA.@allowscalar f(args...)
  • is_CuArray_type(::Type{T}) where {T <: CUDA.CuArray} = true

I had to move a few remapping interpolate field functions, so that we can dispatch between device types.

Apply formatter
@charleskawczynski charleskawczynski force-pushed the ck/cuda_ext branch 13 times, most recently from 93bf38e to 743eaee Compare April 24, 2024 01:21
@charleskawczynski charleskawczynski merged commit ca24ff9 into main Apr 24, 2024
12 of 16 checks passed
@charleskawczynski charleskawczynski deleted the ck/cuda_ext branch April 24, 2024 15:31
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.

Move support for CUDA to extension
1 participant