devito icon indicating copy to clipboard operation
devito copied to clipboard

Check Subdimension.local is honored to avoid OOB accesses

Open FabioLuporini opened this issue 4 years ago • 4 comments

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

FabioLuporini avatar Mar 13 '20 10:03 FabioLuporini

update: this is due to SubDimension(local=...

FabioLuporini avatar Mar 18 '20 15:03 FabioLuporini

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 ?

FabioLuporini avatar Mar 18 '20 15:03 FabioLuporini

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

mloubout avatar Mar 18 '20 15:03 mloubout

No would OOB for the constant case still.

mloubout avatar Mar 18 '20 15:03 mloubout