Skip to content

Commit

Permalink
Apply formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Apr 22, 2024
1 parent c428f93 commit 495e8de
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 18 deletions.
4 changes: 2 additions & 2 deletions ext/cuda/data_layouts.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import ClimaCore.DataLayouts: IJKFVH,IJFH,VIJFH,VIFH,IFH,IJF,IF,VF,DataF
import ClimaCore.DataLayouts: IJFHStyle,VIJFHStyle,VFStyle,DataFStyle
import ClimaCore.DataLayouts: IJKFVH, IJFH, VIJFH, VIFH, IFH, IJF, IF, VF, DataF
import ClimaCore.DataLayouts: IJFHStyle, VIJFHStyle, VFStyle, DataFStyle
import ClimaCore.DataLayouts: promote_parent_array_type
import ClimaCore.DataLayouts: parent_array_type
import Adapt
Expand Down
3 changes: 2 additions & 1 deletion ext/cuda/fields.jl
Original file line number Diff line number Diff line change
Expand Up @@ -310,4 +310,5 @@ function Adapt.adapt_structure(
)
end

cuda_synchronize(device::ClimaComms.CUDADevice; kwargs...) = CUDA.synchronize(; kwargs...)
cuda_synchronize(device::ClimaComms.CUDADevice; kwargs...) =
CUDA.synchronize(; kwargs...)
3 changes: 2 additions & 1 deletion ext/cuda/matrix_fields_multiple_field_solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import ClimaCore.MatrixFields: multiple_field_solve!
import ClimaCore.MatrixFields: is_CuArray_type
import ClimaCore.MatrixFields: allow_scalar_func

allow_scalar_func(::ClimaComms.CUDADevice, f, args) = CUDA.@allowscalar f(args...)
allow_scalar_func(::ClimaComms.CUDADevice, f, args) =
CUDA.@allowscalar f(args...)

is_CuArray_type(::Type{T}) where {T <: CUDA.CuArray} = true

Expand Down
2 changes: 1 addition & 1 deletion ext/cuda/operators_sem_shmem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -257,4 +257,4 @@ Base.@propagate_inbounds function operator_fill_shmem!(
Wv₂[i, j, vt] = W Geometry.covariant2(arg, local_geometry)
Wv₃[i, j, vt] = W Geometry.covariant3(arg, local_geometry)
end
end
end
4 changes: 2 additions & 2 deletions ext/cuda/operators_spectral_element.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ Base.@propagate_inbounds function get_node(
Operators.operator_evaluate(sbc.op, sbc.work, sbc.axes, ij, slabidx)
end

cuda_sync_threads(::SpectralBroadcasted{CUDASpectralStyle}) = CUDA.sync_threads()
cuda_sync_threads(::SpectralBroadcasted{CUDASpectralStyle}) =
CUDA.sync_threads()

function Base.copyto!(
out::Field,
Expand Down Expand Up @@ -192,4 +193,3 @@ end
Base.@propagate_inbounds function resolve_shmem!(obj, ij, slabidx)
nothing
end

6 changes: 3 additions & 3 deletions ext/cuda/remapping_distributed.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import ClimaCore: Topologies, Spaces, Fields
import ClimaComms
import CUDA
using CUDA: @cuda
import ClimaCore.Remapping: _set_interpolated_values_device!,
_set_interpolated_values!
import ClimaCore.Remapping:
_set_interpolated_values_device!, _set_interpolated_values!
function _set_interpolated_values_device!(
out::AbstractArray,
field::Fields.Field,
Expand Down Expand Up @@ -36,7 +36,7 @@ function _set_interpolated_values!(
vert_interpolation_weights::AbstractArray,
vert_bounding_indices::AbstractArray,
field_values,
::ClimaComms.CUDADevice
::ClimaComms.CUDADevice,
)

nblocks, _ = size(interpolation_matrix[1])
Expand Down
8 changes: 4 additions & 4 deletions src/MatrixFields/MatrixFields.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ function Base.show(io::IO, field::ColumnwiseBandMatrixField)
end
column_field = Fields.column(field, 1, 1, 1)
io = IOContext(io, :compact => true, :limit => true)
allow_scalar_func(Base.print_array, (
io,
column_field2array_view(column_field),
))
allow_scalar_func(
Base.print_array,
(io, column_field2array_view(column_field)),
)
else
# When a BandedMatrix with non-number entries is printed, it currently
# either prints in an illegible format (e.g., if it has AxisTensor or
Expand Down
3 changes: 2 additions & 1 deletion src/MatrixFields/field_matrix_iterative_solver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,8 @@ check_field_matrix_solver(alg::StationaryIterativeSolve, cache, A, b) =
is_CuArray_type(::Type{T}) where {T} = false
function run_field_matrix_solver!(alg::StationaryIterativeSolve, cache, x, A, b)
P = lazy_or_concrete_preconditioner(alg.P_alg, cache.P_cache, A)
using_cuda = is_CuArray_type(ClimaComms.array_type(concrete_field_vector(b)))
using_cuda =
is_CuArray_type(ClimaComms.array_type(concrete_field_vector(b)))
if get_debug(alg) && !using_cuda
@debug begin
e₀ = concrete_field_vector(b) # Initialize e to any nonzero vector.
Expand Down
6 changes: 3 additions & 3 deletions src/Remapping/distributed_remapping.jl
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ function _set_interpolated_values!(remapper::Remapper, fields)
remapper.vert_interpolation_weights,
remapper.vert_bounding_indices,
tuple(map(f -> Fields.field_values(f), fields)...),
ClimaComms.device(first(fields))
ClimaComms.device(first(fields)),
)
end

Expand Down Expand Up @@ -496,7 +496,7 @@ function _set_interpolated_values!(
vert_interpolation_weights::AbstractArray,
vert_bounding_indices::AbstractArray,
fields_values,
::ClimaComms.AbstractDevice
::ClimaComms.AbstractDevice,
)
set_interpolated_values_cpu_kernel!(
out,
Expand All @@ -518,7 +518,7 @@ function _set_interpolated_values!(
::Nothing,
::Nothing,
fields_values,
::ClimaComms.AbstractDevice
::ClimaComms.AbstractDevice,
)

space = axes(first(fields))
Expand Down

0 comments on commit 495e8de

Please sign in to comment.