@@ -9,15 +9,18 @@ import ClimaComms
9
9
@static pkgversion (ClimaComms) >= v " 0.6" && ClimaComms. @import_required_backends
10
10
11
11
function benchmarkcopyto! (device, data, val, name)
12
+ data_rhs = similar (data)
13
+ fill! (data_rhs, val)
12
14
println (" Benchmarking ClimaCore copyto! for $name DataLayout" )
13
- bc = Base. Broadcast. broadcasted (identity, val)
15
+ bc = Base. Broadcast. broadcasted (identity, data_rhs)
16
+ bcp = Base. Broadcast. broadcasted (identity, parent (data_rhs))
14
17
trial = @benchmark ClimaComms. @cuda_sync $ device Base. copyto! ($ data, $ bc)
15
18
show (stdout , MIME (" text/plain" ), trial)
16
19
println ()
17
20
println (" Benchmarking array copyto! for $name DataLayout" )
18
21
trial = @benchmark ClimaComms. @cuda_sync $ device Base. copyto! (
19
22
$ (parent (data)),
20
- $ bc ,
23
+ $ bcp ,
21
24
)
22
25
show (stdout , MIME (" text/plain" ), trial)
23
26
println ()
37
40
data = DataF {S} (device_zeros (FT,Nf)); benchmarkcopyto! (device, data, 3 , " DataF" ); @test all (parent (data) .== 3 )
38
41
data = IJFH {S, Nij, Nh} (device_zeros (FT,Nij,Nij,Nf,Nh)); benchmarkcopyto! (device, data, 3 , " IJFH" ); @test all (parent (data) .== 3 )
39
42
data = IFH {S, Nij, Nh} (device_zeros (FT,Nij,Nf,Nh)); benchmarkcopyto! (device, data, 3 , " IFH" ); @test all (parent (data) .== 3 )
40
- data = IJF {S, Nij} (device_zeros (FT,Nij,Nij,Nf)); benchmarkcopyto! (device, data, 3 , " IJF" ); @test all (parent (data) .== 3 )
41
- data = IF {S, Nij} (device_zeros (FT,Nij,Nf)); benchmarkcopyto! (device, data, 3 , " IF" ); @test all (parent (data) .== 3 )
43
+ # The parent array of IJF and IF datalayouts are MArrays, and can therefore not be passed into CUDA kernels on the RHS.
44
+ # data = IJF{S, Nij}(device_zeros(FT,Nij,Nij,Nf)); benchmarkcopyto!(device, data, 3, "IJF" ); @test all(parent(data) .== 3)
45
+ # data = IF{S, Nij}(device_zeros(FT,Nij,Nf)); benchmarkcopyto!(device, data, 3, "IF" ); @test all(parent(data) .== 3)
42
46
data = VF {S, Nv} (device_zeros (FT,Nv,Nf)); benchmarkcopyto! (device, data, 3 , " VF" ); @test all (parent (data) .== 3 )
43
47
data = VIJFH {S,Nv,Nij,Nh} (device_zeros (FT,Nv,Nij,Nij,Nf,Nh));benchmarkcopyto! (device, data, 3 , " VIJFH" ); @test all (parent (data) .== 3 )
44
48
data = VIFH {S, Nv, Nij, Nh} (device_zeros (FT,Nv,Nij,Nf,Nh)); benchmarkcopyto! (device, data, 3 , " VIFH" ); @test all (parent (data) .== 3 )
0 commit comments