Skip to content

Commit

Permalink
Merge pull request #1987 from CliMA/dy/level_placeholder
Browse files Browse the repository at this point in the history
Add LevelPlaceholderSpace
  • Loading branch information
dennisYatunin committed Sep 13, 2024
2 parents 476d93c + 83f7959 commit 37a864f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ ClimaCore.jl Release Notes
main
-------

v0.14.15
-------

- Added support for mixing extruded and horizontal spaces in GPU kernels. PR [#1987](https://github.com/CliMA/ClimaCore.jl/pull/1987).

v0.14.14
-------

Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ClimaCore"
uuid = "d414da3d-4745-48bb-8d80-42e94e092884"
authors = ["CliMA Contributors <[email protected]>"]
version = "0.14.14"
version = "0.14.15"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
19 changes: 14 additions & 5 deletions src/Operators/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,21 @@ end

# Functions for CUDASpectralStyle
struct PlaceholderSpace <: Spaces.AbstractSpace end
struct LevelPlaceholderSpace <: Spaces.AbstractSpace end
struct CenterPlaceholderSpace <: Spaces.AbstractSpace end
struct FacePlaceholderSpace <: Spaces.AbstractSpace end


placeholder_space(current_space, parent_space) = current_space
placeholder_space(current_space::T, parent_space::T) where {T} =
PlaceholderSpace()
placeholder_space(current_space, parent_space) = current_space
placeholder_space(
current_space::Spaces.AbstractPointSpace,
parent_space::Spaces.AbstractFiniteDifferenceSpace,
) = LevelPlaceholderSpace()
placeholder_space(
current_space::Spaces.AbstractSpectralElementSpace,
parent_space::Spaces.ExtrudedFiniteDifferenceSpace,
) = LevelPlaceholderSpace()
placeholder_space(
current_space::Spaces.CenterFiniteDifferenceSpace,
parent_space::Spaces.FaceFiniteDifferenceSpace,
Expand All @@ -93,8 +101,12 @@ placeholder_space(
parent_space::Spaces.CenterExtrudedFiniteDifferenceSpace,
) = FacePlaceholderSpace()

@inline reconstruct_placeholder_space(current_space, parent_space) =
current_space
@inline reconstruct_placeholder_space(::PlaceholderSpace, parent_space) =
parent_space
@inline reconstruct_placeholder_space(::LevelPlaceholderSpace, parent_space) =
Spaces.level(parent_space, left_idx(parent_space)) # extract arbitrary level
@inline reconstruct_placeholder_space(
::CenterPlaceholderSpace,
parent_space::Spaces.FaceFiniteDifferenceSpace,
Expand All @@ -111,9 +123,6 @@ placeholder_space(
::FacePlaceholderSpace,
parent_space::Spaces.CenterExtrudedFiniteDifferenceSpace,
) = Spaces.FaceExtrudedFiniteDifferenceSpace(parent_space)
@inline reconstruct_placeholder_space(current_space, parent_space) =
current_space


strip_space(obj, parent_space) = obj

Expand Down

2 comments on commit 37a864f

@dennisYatunin
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/115104

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.14.15 -m "<description of version>" 37a864f8239790f52abab451e3b2ef074bdaf63b
git push origin v0.14.15

Please sign in to comment.