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

Function _selectUnitProc

source/backend/cpu/CPURaster.cpp:175–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173}
174
175static BlitProc _selectUnitProc(int bytes, int stride, int ds) {
176 auto core = MNNGetCoreFunctions();
177 auto proc = core->MNN1BitcopyFast;
178 switch (bytes) {
179 case 4:
180 if (ds == 1 && (stride == 1 || stride == 0)) {
181 proc = core->MNN4BitcopyFast;
182 } else {
183 proc = core->MNN4BitcopyWithStride;
184 }
185 break;
186 case 2:
187 if (ds == 1 && (stride == 1 || stride == 0)) {
188 proc = core->MNN2BitcopyFast;
189 } else {
190 proc = core->MNN2BitcopyWithStride;
191 }
192 break;
193 case 1:
194 if (ds == 1 && (stride == 1 || stride == 0)) {
195 proc = core->MNN1BitcopyFast;
196 } else {
197 proc = core->MNN1BitcopyWithStride;
198 }
199 break;
200 default:
201 MNN_ASSERT(false);
202 break;
203 }
204 return proc;
205}
206static void _zero(const Tensor::InsideDescribe::Region& slice, int bytes, uint8_t* dstPtr) {
207 for (int z=0; z<slice.size[0]; ++z) {
208 auto dstZ = dstPtr + (z) * slice.dst.stride[0] * bytes;

Callers 2

_blitFunction · 0.85
onExecuteMethod · 0.85

Calls 1

MNNGetCoreFunctionsFunction · 0.85

Tested by

no test coverage detected