@@ -13,7 +13,7 @@ struct Compressor{I}
1313end
1414@inline (i:: Compressor{I} )(n) where {I} = @inbounds i. inner[n]
1515
16- struct SIMDFunction{F,C1,C2}
16+ struct SIMDFunction{F,C1,C2,T }
1717 f:: F
1818 comp1:: C1
1919 comp2:: C2
@@ -22,6 +22,7 @@ struct SIMDFunction{F,C1,C2}
2222 o2:: Int
2323 o1step:: Int
2424 o2step:: Int
25+ tsize:: T
2526end
2627
2728"""
@@ -35,14 +36,14 @@ Returns a `SIMDFunction` using the `gen`.
3536- `o1`: offset for the derivative evalution
3637- `o2`: offset for the second-order derivative evalution
3738"""
38- function SIMDFunction (gen:: Base.Generator , o0 = 0 , o1 = 0 , o2 = 0 )
39+ function SIMDFunction (gen:: Base.Generator , o0 = 0 , o1 = 0 , o2 = 0 ; tsize = () )
3940
4041 f = gen. f (Par (eltype (gen. iter)))
4142
42- _simdfunction (f, o0, o1, o2)
43+ _simdfunction (f, o0, o1, o2; tsize = tsize )
4344end
4445
45- function _simdfunction (f, o0, o1, o2)
46+ function _simdfunction (f, o0, o1, o2; tsize = () )
4647 d = f (Identity (), AdjointNodeSource (nothing ))
4748 y1 = []
4849 ExaModels. grpass (d, nothing , y1, nothing , 0 , NaN )
@@ -59,5 +60,5 @@ function _simdfunction(f, o0, o1, o2)
5960 o2step = length (a2)
6061 c2 = Compressor (Tuple (findfirst (isequal (i), a2) for i in y2))
6162
62- SIMDFunction (f, c1, c2, o0, o1, o2, o1step, o2step)
63+ SIMDFunction (f, c1, c2, o0, o1, o2, o1step, o2step, tsize )
6364end
0 commit comments