From d5a771fa5fa18bf83cb9745d7c7c713cf3dbc7ac Mon Sep 17 00:00:00 2001 From: Arseniy Obolenskiy Date: Fri, 3 Jan 2025 15:09:22 +0100 Subject: [PATCH] use uint32_t for masks to avoid overflow --- src/plugins/intel_cpu/src/nodes/subgraph.cpp | 6 +++--- src/plugins/intel_cpu/src/nodes/subgraph.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/intel_cpu/src/nodes/subgraph.cpp b/src/plugins/intel_cpu/src/nodes/subgraph.cpp index 0078c69c15533d..ba6f1eda215dce 100644 --- a/src/plugins/intel_cpu/src/nodes/subgraph.cpp +++ b/src/plugins/intel_cpu/src/nodes/subgraph.cpp @@ -236,7 +236,7 @@ struct SubgraphCodeGeneratorKey { bool operator==(const SubgraphCodeGeneratorKey& rhs) const; std::shared_ptr attrs = nullptr; - uint8_t broadcasting_mask = 0; + uint32_t broadcasting_mask = 0; }; struct SubgraphShapeInferResultKey { @@ -738,8 +738,8 @@ Subgraph::ControlFlowPasses Subgraph::getControlFlowPasses() const { return backend_passes; } -uint8_t Subgraph::getBroadcastingMask(const std::vector& input_shapes) { - uint8_t mask = 0; +uint32_t Subgraph::getBroadcastingMask(const std::vector& input_shapes) { + uint32_t mask = 0; OPENVINO_ASSERT(broadcastable_inputs.size() <= sizeof(mask) * CHAR_BIT, "Incorrect size of broadcastable inputs of Subgraph"); for (const auto& broadcastable_input : broadcastable_inputs) { diff --git a/src/plugins/intel_cpu/src/nodes/subgraph.h b/src/plugins/intel_cpu/src/nodes/subgraph.h index aac0fa1ea2f535..a84e46d9ae02da 100644 --- a/src/plugins/intel_cpu/src/nodes/subgraph.h +++ b/src/plugins/intel_cpu/src/nodes/subgraph.h @@ -70,7 +70,7 @@ class Subgraph : public Node { std::pair, std::vector> getIOPrecisions() const; static uint64_t getBodyHash(const std::shared_ptr& snippet); - uint8_t getBroadcastingMask(const std::vector& input_shapes); + uint32_t getBroadcastingMask(const std::vector& input_shapes); using DataFlowPasses = std::vector; using ControlFlowPasses = std::vector;