forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ARM CPU] Fix eltwise op tests (Divide) (openvinotoolkit#17029)
* update skip list * skip change * fix divide * review fixes * review fixes #2
- Loading branch information
Showing
4 changed files
with
55 additions
and
9 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
src/plugins/intel_cpu/src/transformations/cpu_opset/arm/pass/decompose_integer_divide.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (C) 2020-2023 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#include "decompose_integer_divide.hpp" | ||
#include <ngraph/opsets/opset1.hpp> | ||
#include <ngraph/rt_info.hpp> | ||
|
||
namespace ov { | ||
namespace intel_cpu { | ||
|
||
DecomposeIntegerDivide::DecomposeIntegerDivide() { | ||
register_matcher(std::make_shared<ngraph::pattern::Matcher>(ngraph::pattern::wrap_type<ngraph::opset1::Divide>(), "DecomposeIntegerDivide"), | ||
[](ngraph::pattern::Matcher& m) { | ||
auto divide = std::dynamic_pointer_cast<ngraph::opset1::Divide>(m.get_match_root()); | ||
if (!divide) { | ||
return false; | ||
} | ||
if (!divide->get_element_type().is_integral_number()) { | ||
return false; | ||
} | ||
|
||
auto new_divide = std::make_shared<ngraph::opset1::Divide>(divide->input_value(0), divide->input_value(1)); | ||
auto new_floor = std::make_shared<ngraph::opset1::Floor>(new_divide); | ||
new_floor->set_friendly_name(divide->get_friendly_name()); | ||
ngraph::copy_runtime_info(divide, new_floor); | ||
ngraph::replace_node(divide, new_floor); | ||
return true; | ||
}); | ||
} | ||
|
||
} // namespace intel_cpu | ||
} // namespace ov |
19 changes: 19 additions & 0 deletions
19
src/plugins/intel_cpu/src/transformations/cpu_opset/arm/pass/decompose_integer_divide.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (C) 2020-2023 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#pragma once | ||
|
||
#include <ngraph/pattern/op/wrap_type.hpp> | ||
#include <ngraph/pass/graph_rewrite.hpp> | ||
|
||
namespace ov { | ||
namespace intel_cpu { | ||
|
||
class DecomposeIntegerDivide: public ngraph::pass::MatcherPass { | ||
public: | ||
OPENVINO_RTTI("DecomposeIntegerDivide", "0"); | ||
DecomposeIntegerDivide(); | ||
}; | ||
|
||
} // namespace intel_cpu | ||
} // namespace ov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters