MCPcopy Create free account
hub / github.com/OAID/Tengine / OnGetNodeDumpAttr

Method OnGetNodeDumpAttr

driver/cpu/cpu_driver.cpp:417–450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

415}
416
417bool CPUDriver::OnGetNodeDumpAttr(DevContext* context, Subgraph* graph, const char* name, void* buf, int size)
418{
419 if(size != sizeof(NodeDumpMsg))
420 {
421 set_tengine_errno(EINVAL);
422 return false;
423 }
424
425 NodeDumpMsg* msg = ( NodeDumpMsg* )buf;
426 const char* node_name = msg->node_name;
427
428 Node* node = graph->FindNode(node_name);
429
430 if(node == nullptr)
431 {
432 set_tengine_errno(EINVAL);
433 return false;
434 }
435
436 if(!node->ExistAttr(ATTR_NODE_OPS))
437 {
438 set_tengine_errno(EINVAL);
439 return false;
440 }
441
442 NodeOps* node_ops = any_cast<NodeOps*>(node->GetAttr(ATTR_NODE_OPS));
443
444 msg->ret_number = node_ops->GetDump(node, msg->buf, msg->buf_size);
445
446 if(msg->ret_number >= 0)
447 return true;
448 else
449 return false;
450}
451
452bool CPUDriver::OnGetGraphPerfAttr(DevContext* context, Subgraph* graph, const char* name, void* buf, int size)
453{

Callers

nothing calls this directly

Calls 5

set_tengine_errnoFunction · 0.85
GetDumpMethod · 0.80
FindNodeMethod · 0.45
ExistAttrMethod · 0.45
GetAttrMethod · 0.45

Tested by

no test coverage detected