Skip to content

Removing the obsolete promotions for reductions #137

@kimikage

Description

@kimikage

The current codebase has no compatibility with Julia v0.6, because the syntax for parametric methods has been fully changed to the current (i.e.where) style. I think the backporting is not easy. Therefore, the following codes are no longer useful.

if isdefined(Base, :r_promote)
# Julia v0.6
Base.r_promote(::typeof(+), x::FixedPoint{T}) where {T} = Treduce(x)
Base.r_promote(::typeof(*), x::FixedPoint{T}) where {T} = Treduce(x)
Base.reducedim_init(f::typeof(identity),
op::typeof(+),
A::AbstractArray{T}, region) where {T <: FixedPoint} =
Base.reducedim_initarray(A, region, zero(Treduce))
Base.reducedim_init(f::typeof(identity),
op::typeof(*),
A::AbstractArray{T}, region) where {T <: FixedPoint} =
Base.reducedim_initarray(A, region, oneunit(Treduce))
else

Removing the obsolete promotions may help improve the promotion rules. For example, the current promotions use const Treduce = Float64, but I don't think it is always pretty good. (I can expect the negative impact of the braking change to be significant, though.)
Moreover, it ostensibly improves the code coverage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions