JuliaArrays / ArrayViews.jl

A Julia package to explore a new system of array views
MIT License
19 stars 18 forks source link

Fix deprecations on 0.6 #53

Closed goretkin closed 6 years ago

goretkin commented 6 years ago

https://github.com/JuliaArrays/ArrayViews.jl/pull/50 didn't catch these

andreasnoack commented 6 years ago

FemtoClearner will do even more if we bump the requirement to Julia 0.6. I can see that tests are failing on 0.5 so this might not be valid on 0.5. I think we should just bump the requirements.

andreasnoack commented 6 years ago

Should have pinged you. I looked into the ambiguities in #56

goretkin commented 6 years ago

I just saw. Perfect! I wasn't sure what I was doing anyway ;)

Personally I think it's a good idea to drop 0.5.0 and use 0.6.0. Not sure who else is using this package. I'm just trying to get zero-allocation views, which will hopefully be in the next Julia release anyway.

goretkin commented 6 years ago

How can femtobot be triggered to handle the 0.6.0 deprecations?

andreasnoack commented 6 years ago

I'm just trying to get zero-allocation views, which will hopefully be in the next Julia release anyway.

I'm not so sure about that. @yuyichao Have you been doing any work on this?

yuyichao commented 6 years ago

I guess you need to define "zero-allocation"....

  1. zero allocation for inline and inbounds subarrays is handled by https://github.com/JuliaLang/julia/pull/23240

  2. zero allocation for inlined but not inbounds subarrays is the next target. The currently on-going series of llvm optimization related PRs are preparation for it. There's a high chance it works only on LLVM 5.0 though.

  3. The next target would be to duplicate the llvm pass to type inference as well using the llvm pass as a template and to help figure out how to redo the IR for optimization in the type inference.

  4. zero allocation for non-inlined inbounds subarray is a completely different matter since it requires collecting escape info in type inference correctly.

2 can partially replace 1, and 3 will be a strict superset of 1.

1 or 2 should be doable for the next release. 3 and 4 are not necessarily harder given 2 but both of them are fairly big projects.

goretkin commented 6 years ago

Thanks @yuyichao . Could you clarify what "inline" means? Does sum(@view A[:,1]) count?

yuyichao commented 6 years ago

sum(@view A[:,1])

Doesn't matter. You just need all the user to be inlined.

goretkin commented 6 years ago

What do you mean "doesn't matter"? Could you give an example of an inline usage and a not inline usage?

yuyichao commented 6 years ago

It means that the code contains no information to determine if the fun that uses the subarray is inlined or not.

goretkin commented 6 years ago

I'm sorry, but I'm not following. I know what @inline does for function definitions and @inbounds does for array indexing. Are you talking about either of those?

yuyichao commented 6 years ago

Inbounds is just the macro, yes. But inlining does not require the macro. As long as the function is inlined it is, well, inlined.....