Commit 2276903
committed
Math: Optimize 16 Bit elementwise matrix multiplication function
Implemented optimizations in the 16-bit elementwise
matrix multiplication function by changing accumulator
data type from int64_t to int32_t. This reduces the
instruction cycle count i.e. reducing cycle count by
~51.18%.
Enhance pointer arithmetic within loops for better
readability and compiler optimization opportunities
Eliminate unnecessary conditionals by directly
handling Q0 data in the algorithm's core logic
Update fractional bit shift and rounding logic for more
accurate fixed-point calcualations
Performance gains from these optimizations include a 1.08%
reduction in memory usage for the elementwise matrix
multiplication.
Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>1 parent 8502790 commit 2276903
1 file changed
+17
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | | - | |
100 | 99 | | |
101 | | - | |
102 | | - | |
103 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
104 | 109 | | |
105 | | - | |
106 | | - | |
107 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
108 | 117 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | 118 | | |
120 | 119 | | |
121 | 120 | | |
| |||
0 commit comments