MCPcopy Create free account
hub / github.com/ARM-software/armnn / BuildSme2ShapeProfile

Function BuildSme2ShapeProfile

src/armnn/Sme2ShapePolicy.cpp:296–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294}
295
296Sme2ShapeProfile BuildSme2ShapeProfile(const Graph& graph, bool reduceFp32ToFp16)
297{
298 Sme2ShapeProfile profile;
299 profile.m_HasFp16 = reduceFp32ToFp16;
300
301 for (const Layer* layer : graph)
302 {
303 switch (layer->GetType())
304 {
305 case LayerType::Convolution2d:
306 RecordConvolution2d(profile, *layer);
307 break;
308 case LayerType::FullyConnected:
309 RecordFullyConnected(profile, *layer);
310 break;
311 case LayerType::BatchMatMul:
312 RecordBatchMatMul(profile, *layer);
313 break;
314 case LayerType::DepthwiseConvolution2d:
315 RecordDepthwiseConvolution2d(profile, *layer);
316 break;
317 default:
318 for (unsigned int i = 0; i < layer->GetNumInputSlots(); ++i)
319 {
320 if (layer->GetInputSlot(i).IsTensorInfoSet())
321 {
322 RecordTensorType(profile, layer->GetInputSlot(i).GetTensorInfo());
323 }
324 }
325 for (unsigned int i = 0; i < layer->GetNumOutputSlots(); ++i)
326 {
327 if (layer->GetOutputSlot(i).IsTensorInfoSet())
328 {
329 RecordTensorType(profile, layer->GetOutputSlot(i).GetTensorInfo());
330 }
331 }
332 break;
333 }
334 }
335
336 return profile;
337}
338
339unsigned int CapWorkerCount(unsigned int workers, unsigned int cap)
340{

Callers 1

ApplySme2ShapePolicyFunction · 0.85

Calls 10

RecordConvolution2dFunction · 0.85
RecordFullyConnectedFunction · 0.85
RecordBatchMatMulFunction · 0.85
RecordTensorTypeFunction · 0.85
GetOutputSlotMethod · 0.80
GetTypeMethod · 0.45
GetNumInputSlotsMethod · 0.45
IsTensorInfoSetMethod · 0.45
GetNumOutputSlotsMethod · 0.45

Tested by

no test coverage detected