Skip to content

Commit

Permalink
Manually type-stabilize SideEffect in gemm examples
Browse files Browse the repository at this point in the history
This reverts a prt of df6611b
  • Loading branch information
tkf committed Jul 20, 2019
1 parent e1bfdab commit fa8f928
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions benchmark/gemm.jl
Expand Up @@ -16,6 +16,7 @@ function _ndrmul_rf()

rf = SideEffect() do (c, a, b)
c[] = muladd(a, b, c[])
return
end

return maybe_usesimd(BottomRF{Any}(rf), simd)
Expand Down
2 changes: 1 addition & 1 deletion docs/Manifest.toml
Expand Up @@ -187,7 +187,7 @@ version = "0.5.5"

[[Transducers]]
deps = ["ArgCheck", "BangBang", "InitialValues", "Markdown", "Requires", "Setfield"]
git-tree-sha1 = "855ad83dbdc6a275be746431d001e8f3b45498f8"
git-tree-sha1 = "da651d0e7cf5217239ec1e45885ae4561decbe82"
repo-rev = "master"
repo-url = "https://github.com/tkf/Transducers.jl.git"
uuid = "28d57a85-8fef-5791-bfe6-a80928e7c999"
Expand Down
2 changes: 1 addition & 1 deletion src/NDReducibles.jl
Expand Up @@ -12,7 +12,7 @@ using Base.Broadcast: Broadcasted
using LinearAlgebra: Adjoint, Transpose
using Referenceables: ReferenceableArray, parenttype
using Transducers:
@next!,
@next,
@return_if_reduced,
@simd_if,
Foldable,
Expand Down
3 changes: 2 additions & 1 deletion src/reduce.jl
Expand Up @@ -33,6 +33,7 @@ julia> foreach(
simd = :ivdep, # optional
) do (c, a, b)
c[] += a * b
return # not required but useful for performance
end;
julia> C == A * B
Expand Down Expand Up @@ -128,7 +129,7 @@ end
@inline function _ndreduce(rf, acc, accessed, indexmap0, patterns, i)
@simd_if rf for j in axisfor(patterns, i)
indexmap = (indexmap0..., i => j)
@next!(rf, acc, tryaccess(patterns, indexmap, accessed))
acc = @next(rf, acc, tryaccess(patterns, indexmap, accessed))
end
return acc
end
Expand Down
4 changes: 2 additions & 2 deletions test/Manifest.toml
Expand Up @@ -51,7 +51,7 @@ uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820"

[[IRTest]]
deps = ["Test"]
git-tree-sha1 = "97684b5fe252d479eec33b19eb43e30731b0586f"
git-tree-sha1 = "5f2778f64fdc9d2e29176869ba49167777ed1170"
repo-rev = "master"
repo-url = "https://github.com/tkf/IRTest.jl"
uuid = "c9680f28-2a59-47f6-98e4-d41620d42cd2"
Expand Down Expand Up @@ -169,7 +169,7 @@ version = "0.5.5"

[[Transducers]]
deps = ["ArgCheck", "BangBang", "InitialValues", "Markdown", "Requires", "Setfield"]
git-tree-sha1 = "855ad83dbdc6a275be746431d001e8f3b45498f8"
git-tree-sha1 = "da651d0e7cf5217239ec1e45885ae4561decbe82"
repo-rev = "master"
repo-url = "https://github.com/tkf/Transducers.jl.git"
uuid = "28d57a85-8fef-5791-bfe6-a80928e7c999"
Expand Down

0 comments on commit fa8f928

Please sign in to comment.