taichi icon indicating copy to clipboard operation
taichi copied to clipboard

Validate ndarray dtype in C++ wrapper.

Open ailzhang opened this issue 3 years ago • 2 comments

In deployment scenarios, we may accidentally pass in an ndarray with wrong dtype compared to the one required by the compiled kernel, we should throw proper error to users when it happens.

ailzhang avatar Feb 01 '23 07:02 ailzhang

Also we don't check number of args matches compiled kernel so it might segfault without any message, maybe also good to validate that and throw a proper error :D

ailzhang avatar Feb 01 '23 13:02 ailzhang

right! I encounter this issue when I using u8 ndarray as passed value in JIT which parameter is u32 ndarray, taichi JIT convert the type automaticly. But in AOT mode, I pass u8 ndarray to module, the whole algorithm goes wrong ! I think it's neccessory adding the type checker for taichi AOT

lgyStoic avatar Jul 18 '23 09:07 lgyStoic