Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
fix fix for #22
Browse files Browse the repository at this point in the history
  • Loading branch information
shashi committed Apr 2, 2020
1 parent eb9d499 commit b969b9f
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/blas.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ _name(x::Expr) = (@assert x.head == :(::); x.args[1])
macro reroute(f, g)
fname = f.args[1]
fargs = f.args[2:end]
gname = g.args[1]
gargs = g.args[2:end]
quote
@inline function Cassette.overdub(ctx::SparsityContext,
f::typeof($(esc(fname))),
$(fargs...))
Cassette.recurse(
ctx,
invoke,
f,
$(esc(:(Tuple{$(g.args[2:end]...)}))),
$(esc(gname)),
$(esc(:(Tuple{$(gargs...)}))),
$(map(_name, fargs)...))
end

Expand All @@ -23,8 +25,8 @@ macro reroute(f, g)
Cassette.recurse(
ctx,
invoke,
$(esc(g.args[1])),
$(esc(:(Tuple{$(g.args[2:end]...)}))),
$(esc(gname)),
$(esc(:(Tuple{$(gargs...)}))),
$(map(_name, fargs)...))
end
end
Expand All @@ -34,12 +36,7 @@ end
@reroute LinearAlgebra.BLAS.axpy!(x, y) LinearAlgebra.axpy!(Any,
AbstractArray,
AbstractArray)
@reroute LinearAlgebra.mul!(y::AbstractVector,
A::AbstractVecOrMat,
x::AbstractVector,
α::Number,
β::Number) LinearAlgebra.mul!(AbstractVector,
AbstractVecOrMat,
AbstractVector,
Number,
Number)

gengemv!(tA, α, A, x, β, y) = LinearAlgebra.generic_matvecmul!(y, tA, A, x, LinearAlgebra.MulAddMul(α, β))

@reroute LinearAlgebra.BLAS.gemv!(tA, α, A, x, β, y) gengemv!(Any, Any, Any, Any, Any, Any)

0 comments on commit b969b9f

Please sign in to comment.