File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import ..DataLayouts,
1616 .. Hypsography
1717import ClimaCore. Utilities: half
1818import ClimaCore. Spaces: cuda_synchronize
19- import .. to_cpu
19+ import Adapt
2020
2121using .. RecursiveApply
2222
Original file line number Diff line number Diff line change @@ -399,10 +399,11 @@ function _Remapper(
399399 )
400400 num_dims = num_hdims
401401 else
402- cpu_space = if ClimaComms. device (space) isa ClimaComms. AbstractCPUDevice
402+ device = ClimaComms. device (space)
403+ cpu_space = if device isa ClimaComms. AbstractCPUDevice
403404 space
404405 else
405- to_cpu ( space)
406+ Adapt . adapt (ClimaComms . array_type (device), space)
406407 end
407408 vert_interpolation_weights =
408409 ArrayType (vertical_interpolation_weights (cpu_space, target_zcoords))
@@ -471,7 +472,12 @@ function _Remapper(
471472 cpu_space = if ClimaComms. device (space) isa ClimaComms. AbstractCPUDevice
472473 space
473474 else
474- to_cpu (space)
475+ device = ClimaComms. device (space)
476+ cpu_space = if device isa ClimaComms. AbstractCPUDevice
477+ space
478+ else
479+ Adapt. adapt (ClimaComms. array_type (device), space)
480+ end
475481 end
476482
477483 vert_interpolation_weights =
You can’t perform that action at this time.
0 commit comments