Mill Computing, Inc. › Forums › The Mill › Architecture › Support for multidimensional arrays › Reply To: Support for multidimensional arrays
What I was wondering about is whether Mill can optimize each “step”. So for example, a dope vector for 3D array x, declared as
int32_t x[a:b, c:d, e:f]; // I am "extending" C here to allow arbitrary upper/lower bounds, and a:b is half open
may be
typedef struct { int base, elemsize, size; } Dope;
Dope dv[] = { {a, s1, s0}, {c, s2, s1}, {e, s3, s2} };
// s3 = 4, s2 = s3*(f-e), s1 = s2*(d-c), s0 = s1*(b-a)
Given an expression x[i,j,k]
you’d have to do a bunch of multiplies and additions or subtractions and comparisons. I think you should be able to do computation for each dim. in parallel before a final add.