devito
devito copied to clipboard
Check Subdimension.local is honored to avoid OOB accesses
reproducer:
python tti_example.py
look at the generated code for the padfunc
builtin, you'll see something along the lines of
phi[abc_x_l + 4][y + 4][z + 4] = phi[44][y + 4][z + 4];
the 44
should be a symbolic entity, not an hardcoded number
update: this is due to SubDimension(local=...
however, the +40 due to nbl should become a symbol otherwise it's gonna be OOB if we supply a (much) smaller Function upon op.apply ?
gonna be OOB if we supply a (much) smaller Function upon op.apply ?
THis line should prevent it no? https://github.com/devitocodes/devito/blob/08aa3f8648dfabb43677c44aba1639e5130c9b05/devito/builtins.py#L306
No would OOB for the constant
case still.