diff --git a/src/parameters/Parameters.jl b/src/parameters/Parameters.jl index 3d1fdd8d7..60c5ddfe2 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 ba3255cea..735259e49 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 @@ -162,6 +164,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) @@ -178,15 +181,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