TCcountArgs internal compiler error
Following program fails with Assertion "TCcountArgs (FUNDEF_ARGS (fundef)) == TYgetProductSize (arg_ts)" failed at /home/thomas/repos/sac2c/src/libsac2c/typecheck/specialize.c:321 -- UpdateFixSignature called with incompatible no of arguments!
When removing the unused softmax(float[m] x)
, the error does not occur, so probably something to do with function overloading.
use StdIO: all;
inline
float max(float a, float b)
{
return _ge_SxS_(a, b) ? a : b;
}
inline
float maximum(float[m] x)
{
return with {
([0] <= iv < [m]): _sel_VxA_(iv, x);
}: fold(max, _sel_VxA_([0], x));
}
inline
float[m] maximum(float[m, n] x)
{
return {iv -> _sel_VxA_([0], _sel_VxA_(iv, x))};
}
inline
float[m] softmax(float[m] x)
{
return x;
}
inline
float[m, n] softmax(float[m, n] x)
{
m = maximum(x);
print(_shape_A_(m));
return x;
}
int main()
{
m = 1000;
x = {iv -> 1f | iv < [m]};
StdIO::print(softmax(x));
return _toi_S_(_sel_VxA_([0], softmax(x)));
}