Skip to content

Commit 90f32e3

Browse files
author
Michael Abbott
committed
try to fix ForwardDiff + LoopVec 0.9
1 parent 7896059 commit 90f32e3

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/grad/avxdual.jl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11

22
#========== making ForwardDiff work with LoopVectorization ==========#
33

4-
# using Tullio.LoopVectorization: LoopVectorization, SVec, vconvert, SIMDPirates
54
using .LoopVectorization
6-
using .LoopVectorization: SVec, vconvert, SIMDPirates
75
using Core: VecElement
86

7+
using .ForwardDiff
8+
using .ForwardDiff: Dual, Partials, partials
9+
10+
#=
11+
# using Tullio.LoopVectorization: LoopVectorization, SVec, vconvert, SIMDPirates
12+
913
s1 = SVec{2,Float64}(5.5, 6.6) # SVec{2,Float64}<5.5, 6.6>
1014
# dump(s1)
1115
# SVec{2,Float64}
@@ -19,9 +23,6 @@ s1 |> typeof |> parentmodule # VectorizationBase
1923
2024
# @inline svec(tup::NTuple{N,T}) where {N,T} = SVec{N,T}(tup...)
2125
22-
using .ForwardDiff
23-
using .ForwardDiff: Dual, Partials, partials
24-
2526
d1 = Dual(1.23, (4,0,0))
2627
typeof(d1) # Dual{Nothing,Float64,3}
2728
# dump(d1)
@@ -38,6 +39,8 @@ d1.partials[1]
3839
partials(d1, 1)
3940
# @inline val(d::Dual) = d.value
4041
42+
=#
43+
4144
ForwardDiff.can_dual(::Type{<:SVec}) = true
4245

4346
@inline function Base.:+(x::Dual{Z,T,D}, sv::SVec{N,S}) where {Z,T<:Number,D,N,S}

0 commit comments

Comments
 (0)