Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/plugins/intel_gpu/src/graph/common_utils/jit_term.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ inline JitTerm operator/(const JitTerm& lhs, const JitTerm& rhs) {
return lhs;
}
if (is_number(lhs) && is_number(rhs)) {
return JitTerm{std::to_string(as_number<int64_t>(lhs) / as_number<int64_t>(rhs))};
auto rhs_val = as_number<int64_t>(rhs);
OPENVINO_ASSERT(rhs_val != 0, "Division by zero detected in operator/");
return JitTerm{std::to_string(as_number<int64_t>(lhs) / rhs_val)};
}
return JitTerm{"(" + lhs.str() + " / " + rhs.str() + ")"};
}
Expand All @@ -224,7 +226,9 @@ inline JitTerm operator%(const JitTerm& lhs, const JitTerm& rhs) {
}

if (is_number(lhs) && is_number(rhs)) {
return JitTerm{std::to_string(as_number<int64_t>(lhs) % as_number<int64_t>(rhs))};
auto rhs_val = as_number<int64_t>(rhs);
OPENVINO_ASSERT(rhs_val != 0, "Modulo by zero detected in operator%");
return JitTerm{std::to_string(as_number<int64_t>(lhs) % rhs_val)};
}

return JitTerm{"(" + lhs.str() + " % " + rhs.str() + ")"};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,8 @@ void crop_in_place_optimization::update_in_place_crop_padding_simple_data_format
std::vector<ov::Dimension::value_type> reshape_upper_sizes(output_rank, 0);
padding::DynamicDimsMask reshape_dyn_pad_mask;

OPENVINO_ASSERT(reshape_axis >= 0 && static_cast<size_t>(reshape_axis) < output_rank, "[GPU] Calculated reshape_axis is out of range.");

reshape_lower_sizes[reshape_axis] = lower_sizes[crop_axis];
reshape_upper_sizes[reshape_axis] = upper_sizes[crop_axis];
reshape_dyn_pad_mask[reshape_axis] = 1;
Expand Down
9 changes: 6 additions & 3 deletions src/plugins/intel_gpu/src/graph/impls/ocl/convolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,12 @@ struct convolution_impl : typed_primitive_impl_ocl<convolution> {
&& cp.weights.X().v == 1 && cp.weights.Y().v > 1
&& !(cp.groups == cp.inputs[0].Feature().v && cp.inputs[0].Feature().v == cp.outputs[0].Feature().v)) {
auto can_swap = [](const kernel_selector::Tensor::DataTensor& dt) -> bool {
auto x_channel_idx = static_cast<uint32_t>(kernel_selector::Tensor::DataTensor::Channelndex(dt.GetLayout(),
kernel_selector::Tensor::DataChannelName::X));
auto x_axis_dim = dt.GetDims()[x_channel_idx];
auto x_channel_idx = kernel_selector::Tensor::DataTensor::Channelndex(dt.GetLayout(),
kernel_selector::Tensor::DataChannelName::X);
if (x_channel_idx < 0) {
return false;
}
auto x_axis_dim = dt.GetDims()[static_cast<size_t>(x_channel_idx)];
return (x_axis_dim.pad.Total() == 0 && x_axis_dim.v == 1);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,9 @@ KernelsData ConcatenationKernelBase::GetCommonKernelsData(const Params& params)
s.v.u32 = lastOffset;
kernel.params.scalars.push_back(s);
kernel.params.arguments.push_back({ArgumentDescriptor::Types::SCALAR, 0});
size_t concatChannelIndex = (size_t)DataTensor::Channelndex(orgParams.inputs[i].GetLayout(), GetConcatChannel(orgParams));
lastOffset += (uint32_t)input.GetDims()[concatChannelIndex].v;
auto concatChannelIndex = DataTensor::Channelndex(orgParams.inputs[i].GetLayout(), GetConcatChannel(orgParams));
OPENVINO_ASSERT(concatChannelIndex > -1, "[GPU] Invalid concatenation channel index found.");
lastOffset += (uint32_t)input.GetDims()[static_cast<size_t>(concatChannelIndex)].v;
}

return {kd};
Expand Down
Loading