On 2 Jul 2016, at 1:34 PM, William Yager <will.yager@gmail.com> wrote:

My code to do this is as follows:

https://gist.github.com/wyager/8c468c9d18ad62aff8bc9738aa947ea4


1) Put INLINE pragmas on all the leaf functions, especially ‘kernel’. If the compiler does not inline these functions they won’t fuse. This is a key problem with the Repa approach to fusion.

2) The ‘dimensional’ packages wraps a data type around all those values. I’m not convinced the simplifier will be able to undo the wrapping / unwrapping. You’ll need to inspect the core code to check.

Ben.