Closed lkuper closed 8 years ago
I fixed this problem in Liveness but domain IR doesn't parallelize the result.
"a[3:4].+1" converts to:
((ParallelAccelerator.API.getindex)(a,$(Expr(:new, UnitRange{Int64}, 3, :((Base.select_value)((Base.sle_int)(3,4)::Bool,4,(Base.box)(Int64,(Base.sub_int)(3,1)))::Int64))))::Array{Int64,1} .+ 1)::Array{Int64,1}
and will parallelize but
"a[3:end].+1" converts to:
(ParallelAccelerator.API.getindex)(a,(MiscTest.colon)(3,MiscTest.end)) .+ 1
and this isn't converted to mmap by domain IR.
@ninegua
The solution is not to have the end
keyword at all. Ranges involving end
is only a syntactic sugar, and they are converted to proper size expression once Julia expression is processed by the macro pass. The reason that it is left dangling here is that ParallelAccelerator translates all ref
expression head (at macro level) to getindex
, and didn't take care of end
symbol that may appear inside a ref
expression. A patch is needed for src/api-capture.jl
to fix this.
Fixed in 437e892.
There's also EndpointRanges.
Julia lets you use
end
to represent the last index in a dimension. Right now (under Julia 0.5), code that usesend
in this way fails in liveness with the following error: