Open rrnewton opened 8 years ago
This seems doable.
There are some easy cases like mandelbrot, where the work is done in a single generate
that has a constant
expression as its shape parameter. To make that less trivial, we could have that shape parameter read from an array at runtime.
We could ask the autotuner for some threshold where it's not worth splitting that generate
, make two different programs (one that splits, one that doesn't), then dispatch at runtime by comparing the actual size to the tuned threshold.
Pushing this off till later because we want to go with run1.
We can't analyze the
Exp
expressions which often determine size (at least not without wrapping/intercepting everything that buildsExp
, which would be like making a whole new EDSL). That kind of stinks, but we can still figure out the sizes of some arrays.This could be useful for things like determining a policy for divide and conquer, or deciding when not to fission at all.
Alternatively, if we want to focus on
run1
instead ofrun
, the goal would not be so much to determine static sizes (impossible), but to generate conditional Accelerate programs that test size and dispatch to precompiled alternatives. One goal would be arun1
version of something like matrix multiply that behaves well on all matrix sizes.