Skip to content

Commit

Permalink
use uint32_t for masks to avoid overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
aobolensk committed Jan 3, 2025
1 parent 2e17cd7 commit d5a771f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/plugins/intel_cpu/src/nodes/subgraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ struct SubgraphCodeGeneratorKey {
bool operator==(const SubgraphCodeGeneratorKey& rhs) const;

std::shared_ptr<Subgraph::SubgraphAttrs> attrs = nullptr;
uint8_t broadcasting_mask = 0;
uint32_t broadcasting_mask = 0;
};

struct SubgraphShapeInferResultKey {
Expand Down Expand Up @@ -738,8 +738,8 @@ Subgraph::ControlFlowPasses Subgraph::getControlFlowPasses() const {
return backend_passes;
}

uint8_t Subgraph::getBroadcastingMask(const std::vector<VectorDims>& input_shapes) {
uint8_t mask = 0;
uint32_t Subgraph::getBroadcastingMask(const std::vector<VectorDims>& 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) {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/intel_cpu/src/nodes/subgraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class Subgraph : public Node {
std::pair<std::vector<ov::element::Type>, std::vector<ov::element::Type>> getIOPrecisions() const;

static uint64_t getBodyHash(const std::shared_ptr<snippets::op::Subgraph>& snippet);
uint8_t getBroadcastingMask(const std::vector<VectorDims>& input_shapes);
uint32_t getBroadcastingMask(const std::vector<VectorDims>& input_shapes);

using DataFlowPasses = std::vector<ov::snippets::pass::Manager::PositionedPassBase>;
using ControlFlowPasses = std::vector<ov::snippets::lowered::pass::PassPipeline::PositionedPassLowered>;
Expand Down

0 comments on commit d5a771f

Please sign in to comment.