Multithreaded AKD fold
Compiler version
sac2c 1.3.3-MijasCosta-1111-g2cfd20
build-type: DEBUG
Problem
The following program concetenates 100 [1]
s into a single array and prints the shape.
int[.] rijgen(int[m] x, int[n] y)
{
res_shape = [_add_SxS_(m, n)];
conny = with {
([0] <= iv < [m]): _sel_VxA_(iv, x);
([m] <= iv < res_shape): _sel_VxA_(_sub_VxV_(iv, [m]),
y);
}: genarray(res_shape, 0);
return conny;
}
int main()
{
n = 100;
jean = with {
([0] <= iv < [n]): [1];
}: fold(rijgen, []);
return _sel_VxA_([0], _shape_A_(jean));
}
This gives error
*** SAC runtime error
*** No appropriate instance of function "_MAIN::rijgen :: int[*] int[*] -> int[.] " found!
for backend mt_pth
.
Investigation
The problem seems to be that
MT_MTFUN_DEF_BEGIN( SACwf__MAIN_CL_MT__rijgen__i_S__i_S, , 3, out, int, (SAC_arg_1, (AKD, (NHD, (NUQ, (INT, (GLO, (FPM, (NOT, (NDI, (INT, )))))))))), in, int, (SACl_x, (AUD, (NHD, (NUQ, (INT, (GLO, (FPM, (NOT, (NDI, (INT, )))))))))), in, int, (SACl_y, (AUD, (NHD, (NUQ, (INT, (GLO, (FPM, (NOT, (NDI, (INT, )))))))))))
forgets that arguments x and y are AKD
, and turns it into an AUD
.