[Fix] Graph's input memory offset
Context
The memory manager generates offsets for each output of each layer within the graph, following a given layout (optimized, wrapping, ...).
Then each kernel within the CPP Export needs to get this memory layout for both its inputs and outputs.
However in the case of the very first layer of the graph, the memory layout of the input was not generated (as it is not the output of any layer).
Then default values were set within the _meminfo.jinja template file, assuming the input would always be contiguous data.
However these default values were not correct, causing buffer overflow and segfault.
Changes
Two changes have been made to correct these default offsets :
-
in_sizewas replaced byin_chanwhen needed, according to what was found within the memory manager functions; -
in_sizeofwas added to make sure that the values actually are in bytes as it has recently been chosen.