projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
201498c
)
[mlir/Quant] Allows to use 32 bits storage type
author
Feng Liu
<liufeng.ee@gmail.com>
Wed, 22 Apr 2020 21:14:29 +0000
(14:14 -0700)
committer
Feng Liu
<liufeng.ee@gmail.com>
Thu, 23 Apr 2020 18:18:05 +0000
(11:18 -0700)
Differential Revision: https://reviews.llvm.org/D78671
mlir/lib/Dialect/Quant/Utils/FakeQuantSupport.cpp
patch
|
blob
|
history
diff --git
a/mlir/lib/Dialect/Quant/Utils/FakeQuantSupport.cpp
b/mlir/lib/Dialect/Quant/Utils/FakeQuantSupport.cpp
index
51ed441
..
71b7e04
100644
(file)
--- a/
mlir/lib/Dialect/Quant/Utils/FakeQuantSupport.cpp
+++ b/
mlir/lib/Dialect/Quant/Utils/FakeQuantSupport.cpp
@@
-35,6
+35,15
@@
static bool getDefaultStorageParams(unsigned numBits, bool narrowRange,
qmin = 0;
qmax = 65535;
}
+ } else if (numBits <= 32) {
+ storageType = IntegerType::get(32, ctx);
+ if (isSigned) {
+ qmin = std::numeric_limits<int32_t>::min();
+ qmax = std::numeric_limits<int32_t>::max();
+ } else {
+ qmin = std::numeric_limits<uint32_t>::min();
+ qmax = std::numeric_limits<uint32_t>::max();
+ }
} else {
return true;
}