From 91412c5baf0befc355a41002f9b41a0fec23c146 Mon Sep 17 00:00:00 2001 From: Anna Jaruga Date: Mon, 6 Jan 2025 15:05:06 -0800 Subject: [PATCH 1/2] Help for GPU compilation of sedimentation velocity --- src/parameters/Parameters.jl | 13 +++++++++++++ test/gpu_clima_core_test.jl | 6 +++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/parameters/Parameters.jl b/src/parameters/Parameters.jl index 3d1fdd8d7..ce97241a3 100644 --- a/src/parameters/Parameters.jl +++ b/src/parameters/Parameters.jl @@ -40,4 +40,17 @@ include("MicrophysicsP3.jl") # Terminal velocity parameters (can be used with different microph. schemes) include("TerminalVelocity.jl") +for T in ( + Chen2022VelTypeRain, + Chen2022VelTypeSmallIce, + Chen2022VelTypeLargeIce, + Chen2022VelType, + CloudLiquid, +) + @eval Base.Broadcast.broadcastable(x::$T) = x + @eval Base.ndims(::Type{<:$T}) = 0 + @eval Base.size(::$T) = () + @eval Base.@propagate_inbounds Base.getindex(x::$T, i) = x +end + end # module diff --git a/test/gpu_clima_core_test.jl b/test/gpu_clima_core_test.jl index fd6475c60..f2debc2e7 100644 --- a/test/gpu_clima_core_test.jl +++ b/test/gpu_clima_core_test.jl @@ -14,6 +14,7 @@ import CloudMicrophysics.MicrophysicsNonEq as CMN function make_column(::Type{FT}) where {FT} context = ClimaComms.SingletonCommsContext(ClimaComms.CUDADevice()) + #context = ClimaComms.context() vert_domain = CC.Domains.IntervalDomain( CC.Geometry.ZPoint{FT}(FT(0)), @@ -32,6 +33,7 @@ end function make_extruded_sphere(::Type{FT}) where {FT} context = ClimaComms.SingletonCommsContext(ClimaComms.CUDADevice()) + #context = ClimaComms.context() # Define vertical # domain @@ -145,6 +147,7 @@ function main_3d(::Type{FT}) where {FT} space_3d_w = make_extruded_sphere(FT) ρq = CC.Fields.ones(space_3d_ρq) .* FT(1e-3) + ρ = CC.Fields.ones(space_3d_ρ) w = CC.Fields.zeros(space_3d_w) @@ -161,15 +164,12 @@ using Test @testset "GPU inference failure 1D Float64" begin main_1d(Float64) end - @testset "GPU inference failure 3D Float64" begin main_3d(Float64) end - @testset "GPU inference failure 1D Float32" begin main_1d(Float32) end - @testset "GPU inference failure 3D Float32" begin main_3d(Float32) end From 5727654e19b1281b5357d2a06c7f648ba8de763d Mon Sep 17 00:00:00 2001 From: Anna Jaruga Date: Tue, 14 Jan 2025 11:49:57 -0800 Subject: [PATCH 2/2] try to fix docs --- docs/Project.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/Project.toml b/docs/Project.toml index 29f5321f0..9788670c4 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -19,5 +19,6 @@ Thermodynamics = "b60c26fb-14c3-4610-9d3e-2d17fe7ff00c" UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228" [compat] +Dierckx = "0.5.3" Documenter = "1.1" DocumenterCitations = "1.3.3"