Skip to content

Commit 7cc6c62

Browse files
praaszakladievilya-lavrenov
authored
Remove undefined from switches as it generates compile warning/error (#945)
Use dynamic type instead Signed-off-by: Raasz, Pawel <pawel.raasz@intel.com> Co-authored-by: Alina Kladieva <alina.kladieva@intel.com> Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
1 parent 17e75d0 commit 7cc6c62

File tree

9 files changed

+6
-12
lines changed

9 files changed

+6
-12
lines changed

modules/java_api/src/main/cpp/jni_common.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ static const ov::element::Type_t& get_ov_type(int type)
236236
{
237237
static const std::vector<ov::element::Type_t> java_type_to_ov_type
238238
{
239-
ov::element::Type_t::undefined,
239+
ov::element::Type_t::dynamic,
240240
ov::element::Type_t::dynamic,
241241
ov::element::Type_t::boolean,
242242
ov::element::Type_t::bf16,

modules/nvidia_plugin/src/cuda_config.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ struct Configuration {
5757
ov::streams::Num num_streams = 0;
5858
ov::hint::PerformanceMode performance_mode = ov::hint::PerformanceMode::LATENCY;
5959
ov::hint::ExecutionMode execution_mode = ov::hint::ExecutionMode::PERFORMANCE;
60-
ov::element::Type inference_precision = ov::element::undefined;
60+
ov::element::Type inference_precision = ov::element::dynamic;
6161
};
6262

6363
} // namespace nvidia_gpu

modules/nvidia_plugin/src/cuda_operation_base.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class OperationBase : public IOperationExec, public IOperationMeta, public std::
131131
protected:
132132
std::string node_name_;
133133
std::string type_name_;
134-
ov::element::Type runtime_precision_ = ov::element::undefined;
134+
ov::element::Type runtime_precision_ = ov::element::dynamic;
135135
const IndexCollection input_ids_;
136136
const IndexCollection output_ids_;
137137
WorkbufferIds workbuffer_ids_;

modules/nvidia_plugin/src/ops/gather.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ GatherOp::GatherOp(const CreationContext& context,
4848

4949
const ov::element::Type_t element_type = node.get_input_element_type(0);
5050
switch (element_type) {
51-
case ov::element::Type_t::undefined:
5251
case ov::element::Type_t::dynamic:
5352
case ov::element::Type_t::u1:
5453
throw_ov_exception(fmt::format("Params element type = {} is not supported by Gather operation!",

modules/nvidia_plugin/src/ops/scatter_nd_update.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ ScatterNDUpdateOp::ScatterNDUpdateOp(const CreationContext& context,
2323

2424
const ov::element::Type_t input_type = node.get_input_element_type(0);
2525
switch (input_type) {
26-
case ov::element::Type_t::undefined:
2726
case ov::element::Type_t::dynamic:
2827
case ov::element::Type_t::u1:
2928
throw_ov_exception(fmt::format("Params element type = {} is not supported by ScatterNDUpdate operation!",

modules/nvidia_plugin/src/ops/split.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ SplitOp::SplitOp(const CreationContext& context,
3636
OPENVINO_ASSERT(splitOp->get_output_size() == num_splits_, "Node name: ", GetName());
3737
OPENVINO_ASSERT(input_element_type == output_element_type, "Node name: ", GetName());
3838
switch (input_element_type) {
39-
case ov::element::Type_t::undefined:
4039
case ov::element::Type_t::dynamic:
4140
case ov::element::Type_t::u1:
4241
throw_ov_exception(

modules/nvidia_plugin/src/ops/variadic_split.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ VariadicSplitOp::VariadicSplitOp(const CreationContext& context,
8181
OPENVINO_ASSERT(variadic_split_node->get_input_size() == 3, "Node name: ", GetName());
8282
OPENVINO_ASSERT(input_element_type == output_element_type, "Node name: ", GetName());
8383
switch (input_element_type) {
84-
case ov::element::Type_t::undefined:
8584
case ov::element::Type_t::dynamic:
8685
case ov::element::Type_t::u1:
8786
throw_ov_exception(

modules/nvidia_plugin/tests/functional/shared_tests_instances/single_layer_tests/ov_finite_comparer.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ inline void call_compare(const ov::Tensor& expected,
7777
expected.data<ov::bfloat16>(), actual_buffer, size, threshold, to_check_nans, infinity_value);
7878
break;
7979
case ov::element::Type_t::dynamic:
80-
case ov::element::Type_t::undefined:
8180
FiniteLayerComparer::compare<T_IE, T_IE>(
8281
expected.data<T_IE>(), actual_buffer, size, threshold, to_check_nans, infinity_value);
8382
break;
@@ -98,8 +97,7 @@ void FiniteLayerComparer::compare(const ov::Tensor& expected,
9897
if (expected.get_element_type() == ov::element::Type_t::u4 ||
9998
expected.get_element_type() == ov::element::Type_t::i4) {
10099
k /= 2;
101-
} else if (expected.get_element_type() == ov::element::Type_t::undefined ||
102-
expected.get_element_type() == ov::element::Type_t::dynamic) {
100+
} else if (expected.get_element_type() == ov::element::Type_t::dynamic) {
103101
k = 1;
104102
}
105103
ASSERT_EQ(expected.get_byte_size(), actual.get_byte_size() * k);
@@ -149,4 +147,4 @@ void ov::test::FiniteLayerComparer::compare(const std::vector<ov::Tensor>& expec
149147
const std::vector<ov::Tensor>& actual_outputs) {
150148
FiniteLayerComparer::compare(
151149
expected_outputs, actual_outputs, abs_threshold, this->to_check_nans, this->infinity_value);
152-
}
150+
}

modules/nvidia_plugin/tests/unit/memory_manager/cuda_memory_manager_test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class MemoryManagerTest : public testing::Test, public ov::nvidia_gpu::IOperatio
6060
static constexpr std::string_view empty{""};
6161
return empty;
6262
}
63-
const ov::element::Type& GetRuntimePrecision() const override { return ov::element::undefined; }
63+
const ov::element::Type& GetRuntimePrecision() const override { return ov::element::dynamic; }
6464
gsl::span<const ov::nvidia_gpu::TensorID> GetInputIds() const override { return inputIds_; }
6565
gsl::span<const ov::nvidia_gpu::TensorID> GetOutputIds() const override { return outputIds_; }
6666
};

0 commit comments

Comments
 (0)