Skip to content

Commit

Permalink
Switch to using LinearAlgebra.BLAS
Browse files Browse the repository at this point in the history
Currently some of the rules are calling `blascopy!` and `scal!` without
qualification, which fails, since we haven't done a full `using` for the
BLAS submodule. This adds a `using` and an `import` for `dot` on earlier
versions of Julia to avoid a name conflict between LinearAlgebra and
BLAS which has since been fixed.
  • Loading branch information
ararslan committed Jun 19, 2019
1 parent 8f754f3 commit a4c104f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/ChainRules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@ module ChainRules

using Cassette
using LinearAlgebra
using LinearAlgebra.BLAS
using Base.Broadcast: materialize, materialize!, broadcasted, Broadcasted, broadcastable

import NaNMath, SpecialFunctions, LinearAlgebra, LinearAlgebra.BLAS
if VERSION < v"1.3.0-DEV.142"
# In prior versions, the BLAS submodule also exported `dot`, which caused a conflict
# with its parent module. To get around this, we can simply create a hard binding for
# the one we want to use without qualification.
import LinearAlgebra: dot
end

import NaNMath, SpecialFunctions

export AbstractRule, Rule, frule, rrule

Expand Down
1 change: 0 additions & 1 deletion src/rules/linalg/blas.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package (https://github.com/invenia/DiffLinearAlgebra.jl).
=#

using LinearAlgebra: BlasFloat
using LinearAlgebra.BLAS: gemm

_zeros(x) = fill!(similar(x), zero(eltype(x)))

Expand Down

0 comments on commit a4c104f

Please sign in to comment.