MCPcopy Create free account
hub / github.com/alibaba/MNN / SimpleRank

Function SimpleRank

source/core/ConvolutionCommon.cpp:100–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100static void SimpleRank(int8_t *data, uint32_t cnt, int up) {
101 if (up) {
102 for (uint32_t i = 0; i < cnt; i++) {
103 for (uint32_t j = i + 1; j < cnt; j++) {
104 if (data[i] > data[j]) {
105 int8_t tmp = data[i];
106 data[i] = data[j];
107 data[j] = tmp;
108 }
109 }
110 }
111 } else {
112 for (uint32_t i = 0; i < cnt; i++) {
113 for (uint32_t j = i + 1; j < cnt; j++) {
114 if (data[i] < data[j]) {
115 int8_t tmp = data[i];
116 data[i] = data[j];
117 data[j] = tmp;
118 }
119 }
120 }
121 }
122}
123
124static void InsertSimpleSet(PSIMPLE_SET set, int8_t value) {
125 if (set->CurUniCnt >= set->UniSetSize)

Callers 3

ReadQuanInfoFunction · 0.85
ReadQuanData_cFunction · 0.85
ReadSparseQuanData_cFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected