Type mismatch in EMRL for cuda backend
Compiler
Branch hotfix-2344 from sbs fork, commit bfb9547bba8cc14af96d641acb39051ca2d973ce
Flags -t cuda -check c
.
Code
noinline
double[.] hide(double[.] x)
{
return x;
}
inline
double[32, 256] rollback(double[32, 256] ResultE)
{
V = {[i, j] -> _mul_SxS_(3d, _sel_VxA_([i, j], ResultE))
| [i, j] < [32, 256]};
U = {[j, i] -> _mul_SxS_(2d, _sel_VxA_([i, j], ResultE))
| [j, i] < [256, 32]};
ResultE = {[i] -> hide({[j] -> _sub_SxS_(_sel_VxA_([j, i], U),
_sel_VxA_([i, j], V))})
};
return ResultE;
}
inline
double value(double strike)
{
ResultE = with {}: genarray([32, 256], strike);
for (t = 254; _ge_SxS_(t, 0); t = _sub_SxS_(t, 1)) {
ResultE = rollback(ResultE);
}
return _sel_VxA_([10, 10], ResultE);
}
int main()
{
result = {[i] -> value(_div_SxS_(_tod_S_(i), 1000.0))
| [i] < [OUTER]};
return _toi_S_(_sel_VxA_([0], result));
}
Problem
In 1000 runs, it gives error
Can not assign double[32,256] SACp_emrl_6253_emr_lifted to double[256,32] SACp_pinl_7130__emrl_6250_emr_tmp type mismatch
twice, and segfault 998 times.