forked from iree-org/iree
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Calculate storage bytes through interface method for encoding types. (i…
…ree-org#19413) The revision moves the implementation of storage bytes calculation to `EncodingAttr::calculateStorageSizeInBytes`. If the encoding attribute implements the interface, the implementation has higher priority. Because it knows all the details, including whether packing the data back-to-back or not. The change is not NFC because it also fixes a bug for dynamic cases. The `dynamicDims` value range is not a mixed value range. It is only for dynamic cases. To make the logic correct, we need to use `getDynamicDimIndex()` to get the corresponding dimension index before the update. The revision duplicates two methods from Util to Encoding dialect because we do not want the dependency (i.e., encoding -> util): - getTypeBitWidth - getRoundedElementByteWidth The function argument of `calculateStorageSizeInBytes` method is changed because of the needs. --------- Signed-off-by: hanhanW <[email protected]>
- Loading branch information
Showing
5 changed files
with
147 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters