Commit 60ca608c authored by Diego Caballero's avatar Diego Caballero Committed by Scott Cyphers

Make 'use_mkldnn_kernel' properly deal with non-ops nodes (#2602)

Previous code silently crashes when node is not a op.
parent 6e877f6c
...@@ -678,10 +678,15 @@ bool runtime::cpu::mkldnn_utils::is_mkldnn_padded_layout(const mkldnn::memory::d ...@@ -678,10 +678,15 @@ bool runtime::cpu::mkldnn_utils::is_mkldnn_padded_layout(const mkldnn::memory::d
bool runtime::cpu::mkldnn_utils::use_mkldnn_kernel(const ngraph::Node* node) bool runtime::cpu::mkldnn_utils::use_mkldnn_kernel(const ngraph::Node* node)
{ {
auto op_annotations = static_cast<const ngraph::op::Op*>(node)->get_op_annotations(); if (auto* op_node = dynamic_cast<const ngraph::op::Op*>(node))
return (op_annotations && {
static_pointer_cast<ngraph::runtime::cpu::CPUOpAnnotations>(op_annotations) auto op_annotations = op_node->get_op_annotations();
->is_mkldnn_op()); return (op_annotations &&
static_pointer_cast<ngraph::runtime::cpu::CPUOpAnnotations>(op_annotations)
->is_mkldnn_op());
}
return false;
} }
void runtime::cpu::mkldnn_utils::assign_mkldnn_kernel(Node* node) void runtime::cpu::mkldnn_utils::assign_mkldnn_kernel(Node* node)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment