From fd90cc69758ce171321891952d93abae15cfa18a Mon Sep 17 00:00:00 2001 From: Edward Shogulin Date: Tue, 12 Mar 2024 14:54:49 +0000 Subject: [PATCH] [CPU] [ARM64] int8 support: comment fixes --- .../kernels/aarch64/jit_uni_eltwise_generic.cpp | 17 ++++++++++------- .../single_layer_tests/classes/eltwise.cpp | 4 ++++ .../src/classes/eltwise_chain.cpp | 9 +++------ .../src/classes/eltwise_chain.hpp | 2 +- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/plugins/intel_cpu/src/nodes/kernels/aarch64/jit_uni_eltwise_generic.cpp b/src/plugins/intel_cpu/src/nodes/kernels/aarch64/jit_uni_eltwise_generic.cpp index 471084d4877c0e..adabb899277871 100644 --- a/src/plugins/intel_cpu/src/nodes/kernels/aarch64/jit_uni_eltwise_generic.cpp +++ b/src/plugins/intel_cpu/src/nodes/kernels/aarch64/jit_uni_eltwise_generic.cpp @@ -289,10 +289,10 @@ void load_vector(const T1& data_lane, } } else { if (offset == 0) { - h->ld1(data_lanes, Xbyak_aarch64::ptr(ptr_reg)); + h->ld1(data_lanes, ptr(ptr_reg)); } else { h->add_imm(h->X_DEFAULT_ADDR, ptr_reg, offset, h->X_TMP_0); - h->ld1(data_lanes, Xbyak_aarch64::ptr(h->X_DEFAULT_ADDR)); + h->ld1(data_lanes, ptr(h->X_DEFAULT_ADDR)); } } } @@ -319,9 +319,16 @@ void jit_uni_eltwise_generic::load_vector(const TReg& data, } break; } - case ov::element::i8: + case ov::element::i8: { + utils::load_vector(data.b, data.s, ptr_reg, ptr_offset, broadcast, this); + sshll(data.h8, data.b8, 0); + sshll(data.s4, data.h4, 0); + break; + } case ov::element::u8: { utils::load_vector(data.b, data.s, ptr_reg, ptr_offset, broadcast, this); + ushll(data.h8, data.b8, 0); + ushll(data.s4, data.h4, 0); break; } default: { @@ -342,14 +349,10 @@ void jit_uni_eltwise_generic::load_vector(const TReg& data, break; } case ov::element::i8: { - sshll(data.h8, data.b8, 0); - sshll(data.s4, data.h4, 0); scvtf(data.s, data.s); break; } case ov::element::u8: { - ushll(data.h8, data.b8, 0); - ushll(data.s4, data.h4, 0); ucvtf(data.s, data.s); break; } diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/eltwise.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/eltwise.cpp index f26de5d44ee3ad..e02f6422d8a050 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/eltwise.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/eltwise.cpp @@ -34,6 +34,10 @@ std::string EltwiseLayerCPUTest::getTestCaseName(testing::TestParamInfo& targetInput const auto& funcInput = funcInputs[i]; inputs.insert({funcInput.get_node_shared_ptr(), generate_eltwise_input( funcInput.get_element_type(), - targetInputStaticShapes[i], - (funcInput.get_element_type() == element::i32) || (funcInput.get_element_type() == element::u32) || - (funcInput.get_element_type() == element::i8) || (funcInput.get_element_type() == element::u8))}); + targetInputStaticShapes[i])}); } } @@ -217,7 +215,6 @@ std::vector> inputPrecisionsConvert() { {ElementType::i16, ElementType::f32, ElementType::f32}, {ElementType::u16, ElementType::f32, ElementType::f32}, {ElementType::i32, ElementType::f32, ElementType::f32}, - // { ElementType::u32, ElementType::f32, ElementType::f32 }, // plugin doesn't support {ElementType::f16, ElementType::f32, ElementType::f32}, {ElementType::f32, ElementType::f32, ElementType::f32}, }; diff --git a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/classes/eltwise_chain.hpp b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/classes/eltwise_chain.hpp index bb33a4f87255ed..17954b438abd73 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/classes/eltwise_chain.hpp +++ b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/classes/eltwise_chain.hpp @@ -32,7 +32,7 @@ class EltwiseChainTest : public testing::WithParamInterface, virtual public SubgraphBaseTest { public: static std::string getTestCaseName(const testing::TestParamInfo &obj); - ov::Tensor generate_eltwise_input(const ov::element::Type& type, const ov::Shape& shape, const bool adopt_intervals); + ov::Tensor generate_eltwise_input(const ov::element::Type& type, const ov::Shape& shape); void generate_inputs(const std::vector& targetInputStaticShapes) override; protected: