22const NVALS_complex = 1000
33
44const input_complex = Dict (
5- t => [ (randindomain (t, NVALS_complex, domain),) for (_, _, domain) in base_unary_complex ]
6- for t in (ComplexF32, ComplexF64)
5+ t => [ (randindomain (t, NVALS_complex, domain),) for (_, _, domain) in base_unary_complex]
6+ for t in (ComplexF32, ComplexF64)
77)
88
99const fns_complex = [x[1 : 2 ] for x in base_unary_complex]
@@ -14,30 +14,35 @@ const fns_complex = [x[1:2] for x in base_unary_complex]
1414# )
1515
1616@testset " Definitions and Comparison with Base for Complex" begin
17- for t in (ComplexF32, ComplexF64), i = 1 : length (fns_complex)
18- inp = input_complex[t][i]
19- mod, fn = fns_complex[i]
20- base_fn = getproperty (mod, fn)
21- vml_fn = getproperty (IntelVectorMath, fn)
22- vml_fn! = getproperty (IntelVectorMath, Symbol (fn, " !" ))
23-
24- Test. @test parentmodule (vml_fn) == IntelVectorMath
25-
26- # Test.test_approx_eq(output[t][i], fn(input[t][i]...), "Base $t $fn", "IntelVectorMath $t $fn")
27- baseres = base_fn .(inp... )
28- Test. @test vml_fn (inp... ) ≈ base_fn .(inp... )
29-
30- if inp == 1
31- if fn != :abs && fn != :angle
32- vml_fn! (inp[1 ])
33- Test. @test inp[1 ] ≈ baseres
17+ for t in (ComplexF32, ComplexF64)
18+ @testset " Type: $t " begin
19+ for i = 1 : length (fns_complex)
20+ inp = input_complex[t][i]
21+ mod, fn = fns_complex[i]
22+ base_fn = getproperty (mod, fn)
23+ vml_fn = getproperty (IntelVectorMath, fn)
24+ vml_fn! = getproperty (IntelVectorMath, Symbol (fn, " !" ))
25+
26+ @testset " $fn " begin
27+
28+ Test. @test parentmodule (vml_fn) == IntelVectorMath
29+
30+ # Test.test_approx_eq(output[t][i], fn(input[t][i]...), "Base $t $fn", "IntelVectorMath $t $fn")
31+ baseres = base_fn .(inp... )
32+ Test. @test vml_fn (inp... ) ≈ base_fn .(inp... )
33+
34+ if inp == 1
35+ if fn != :abs && fn != :angle
36+ vml_fn! (inp[1 ])
37+ Test. @test inp[1 ] ≈ baseres
38+ end
39+ elseif length (inp) == 2
40+ out = similar (inp[1 ])
41+ vml_fn! (out, inp... )
42+ Test. @test out ≈ baseres
43+ end
44+ end
3445 end
35- elseif length (inp) == 2
36- out = similar (inp[1 ])
37- vml_fn! (out, inp... )
38- Test. @test out ≈ baseres
3946 end
40-
4147 end
42-
4348end
0 commit comments