@@ -824,16 +824,19 @@ end
824
824
end
825
825
826
826
@testset " signbit" begin
827
- for x in (- 4 , - 3.14 , - 0.0f0 , 0.0 , 0 , 5 , 6.28f0 )
828
- @test @jit (signbit (ConcreteRNumber (x))) == signbit (x) broken = RunningOnTPU
827
+ @testset " $(typeof (x)) " for x in (- 4 , - 3.14 , - 0.0f0 , 0.0 , 0 , 5 , 6.28f0 )
828
+ @test @jit (signbit (ConcreteRNumber (x))) == signbit (x) broken =
829
+ RunningOnTPU && eltype (x) == Float64
829
830
end
830
831
end
831
832
832
833
@testset " copysign" begin
833
- for a in (- 3.14 , - 2 , 0.0 , 2.71 , 42 ), b in (- 7 , - 0.57 , - 0.0 , 1 , 3.14 )
834
+ @testset " $(typeof (a)) $(typeof (b)) " for a in (- 3.14 , - 2 , 0.0 , 2.71 , 42 ),
835
+ b in (- 7 , - 0.57 , - 0.0 , 1 , 3.14 )
834
836
# Make sure also the return type is correct
835
837
@test Reactant. to_number (@jit (copysign (ConcreteRNumber (a), ConcreteRNumber (b)))) ===
836
- copysign (a, b) broken = RunningOnTPU
838
+ copysign (a, b) broken =
839
+ RunningOnTPU && (eltype (a) == Float64 || eltype (b) == Float64)
837
840
end
838
841
end
839
842
@@ -930,10 +933,10 @@ end
930
933
end
931
934
932
935
@testset " @code_xla" begin
933
- x_ra = Reactant. to_rarray (ones (4 ))
936
+ x_ra = Reactant. to_rarray (ones (Float32, 4 ))
934
937
hlo = repr (@code_xla (sin .(x_ra)))
935
- @test contains (hlo, " HloModule" ) broken = RunningOnTPU
936
- @test contains (hlo, " sine" ) broken = RunningOnTPU
938
+ @test contains (hlo, " HloModule" )
939
+ @test contains (hlo, " sine" )
937
940
end
938
941
939
942
@testset " Raise keyword" begin
@@ -1125,7 +1128,7 @@ end
1125
1128
Reactant. MLIR. IR. DUMP_MLIR_DIR[] = dir
1126
1129
@compile sin .(Reactant. to_rarray (Float32[1.0 ]))
1127
1130
for mod in readdir (dir; join= true )
1128
- @test contains (read (mod, String), " hlo.sine" ) broken = RunningOnTPU
1131
+ @test contains (read (mod, String), " hlo.sine" )
1129
1132
end
1130
1133
end
1131
1134
@@ -1135,7 +1138,7 @@ end
1135
1138
@compile exp .(Reactant. to_rarray (Float32[1.0 ]))
1136
1139
# Make sure we don't save anything to file when compilation is
1137
1140
# successful and `DUMP_MLIR_ALWAYS=false`.
1138
- @test isempty (readdir (dir; join= true )) broken = RunningOnTPU
1141
+ @test isempty (readdir (dir; join= true ))
1139
1142
end
1140
1143
1141
1144
Reactant. MLIR. IR. DUMP_MLIR_ALWAYS[] = always_old
@@ -1267,7 +1270,7 @@ accum_fn(x, y) = abs2(x) + abs2(y)
1267
1270
1268
1271
@testset " accumulate" begin
1269
1272
@test @jit (accumulate (accum_fn, a_ra; init= 0.0f0 )) ≈
1270
- accumulate (accum_fn, a; init= 0.0f0 )
1273
+ accumulate (accum_fn, a; init= 0.0f0 ) broken = RunningOnTPU
1271
1274
1272
1275
@test @jit (accumulate (accum_fn, b_ra; init= 0.0f0 , dims= 1 )) ≈
1273
1276
accumulate (accum_fn, b; dims= 1 , init= 0.0f0 ) broken = RunningOnTPU
0 commit comments