Add the ability to Align Tensor Rows and Planes
Some platforms require that the Rows/Planes of tensors are aligned to a specific value.
Add two macros TTL_DEFAULT_INTERNAL_ALIGNMENT and TTL_DEFAULT_EXTERNAL_ALIGNMENT to set these alignement values. The default if undefined is 1 byte.
An alternative to replacing TTL_create_layout() with TTL_create_int_layout() and TTL_create_ext_layout(), may be to support additional optional parameters to convey non-default alignments, but this may conflict with the existing optional parameters:, a single row-spacing stride parameter for 2D layouts and a pair of row-spacing, plane-spacing parameters for 3D layouts. E.g., does TTL_create_layout(row-spacing, 16) mean 3D layout with default alignment or 2D layout with rows aligned on 16 byte boundaries.
Another alternative may be to preprocess the layout parameters before they are fed into TTL_create_layout(), e.g., TTL_create_layout(TTL_align(width, (optional int/ext alignment)), TTL_align(height, (optional int/ext alignment)).
Note that in order for the actual tensor to be properly aligned, its base address must also be aligned. Would be good to check/assert somehow.
Would be good for existing tests to remain intact, thereby demonstrating backward compatibility, and introduce additional tests with explicit alignments.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
Chris Gearing seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.