Converting between devices
ClimaCore.to_device
— Functionout = to_device(device, x::Union{
DataLayouts.AbstractData,
Spaces.AbstractSpace,
Fields.Field,
Fields.FieldVector,
})
Move x
to the given device
.
This is particularly useful to move different types of Space.AbstractSpace
s, Fields.Field
s, and Fields.FieldVector
s from CPUs to GPUs and viceversa.
If the input is already defined on the target device, returns a copy.
This means that out === x
will not in general be satisfied.
ClimaCore.to_cpu
— Functionout = to_cpu(x::Union{
DataLayouts.AbstractData,
Spaces.AbstractSpace,
Fields.Field,
Fields.FieldVector,
})
Move x
backing data to the CPU.
This is particularly useful for Space.AbstractSpace
s, Fields.Field
s, and Fields.FieldVector
s.
Returns a copy.
This means that out === x
will not in general be satisfied.