Skip to content

Commit 319bce8

Browse files
[GPU] Add cpu impl for resample
1 parent 2d78f2a commit 319bce8

File tree

6 files changed

+47
-5
lines changed

6 files changed

+47
-5
lines changed

samples/cpp/benchmark_app/inputs_filling.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -778,10 +778,10 @@ std::map<std::string, ov::TensorVector> get_tensors(std::map<std::string, std::v
778778
// Fill with Numpy arrrays
779779
tensors[input_name].push_back(
780780
get_numpy_tensor(files.second, inputId, batchSize, {input_name, input_info}, &tensor_src_info));
781-
} else if (input_info.is_image()) {
782-
// Fill with Images
783-
tensors[input_name].push_back(
784-
get_image_tensor(files.second, inputId, batchSize, {input_name, input_info}, &tensor_src_info));
781+
// } else if (input_info.is_image()) {
782+
// // Fill with Images
783+
// tensors[input_name].push_back(
784+
// get_image_tensor(files.second, inputId, batchSize, {input_name, input_info}, &tensor_src_info));
785785
} else {
786786
// Fill with binary files
787787
tensors[input_name].push_back(

samples/cpp/benchmark_app/utils.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@ std::vector<benchmark_app::InputsInfo> get_inputs_info(const std::string& shape_
590590

591591
// Precision
592592
info.type = item.get_element_type();
593+
info.type = ov::element::Type_t::f32;
593594
// Partial Shape
594595
if (shape_map.count(name)) {
595596
if (shape_map.at(name).size() > 1) {

src/plugins/intel_gpu/src/graph/impls/cpu/register.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ void register_implementations() {
3131
REGISTER_CPU(tile);
3232
REGISTER_CPU(select);
3333
REGISTER_CPU(reduce);
34+
REGISTER_CPU(resample);
3435
}
3536

3637
} // namespace cpu

src/plugins/intel_gpu/src/graph/impls/cpu/register.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ REGISTER_CPU(broadcast);
5656
REGISTER_CPU(tile);
5757
REGISTER_CPU(select);
5858
REGISTER_CPU(reduce);
59+
REGISTER_CPU(resample);
5960

6061
#undef REGISTER_CPU
6162

src/plugins/intel_gpu/src/graph/impls/registry/registry.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ REGISTER_IMPLS(reshape);
139139
REGISTER_IMPLS(non_max_suppression);
140140
REGISTER_IMPLS(softmax);
141141
REGISTER_IMPLS(range);
142+
//REGISTER_IMPLS(resample);
142143
REGISTER_IMPLS(select);
143144
REGISTER_IMPLS(scatter_update);
144145
REGISTER_IMPLS(scatter_elements_update);
@@ -200,7 +201,7 @@ REGISTER_DEFAULT_IMPLS(space_to_batch, OCL_S);
200201
REGISTER_DEFAULT_IMPLS(space_to_depth, OCL_S);
201202
REGISTER_DEFAULT_IMPLS(swiglu, OCL_S, OCL_D);
202203
REGISTER_DEFAULT_IMPLS(gather_tree, OCL_S);
203-
REGISTER_DEFAULT_IMPLS(resample, OCL_S);
204+
REGISTER_DEFAULT_IMPLS(resample, CPU_S, OCL_S);
204205
REGISTER_DEFAULT_IMPLS(grn, OCL_S);
205206
REGISTER_DEFAULT_IMPLS(ctc_greedy_decoder, OCL_S);
206207
REGISTER_DEFAULT_IMPLS(ctc_loss, OCL_S);

src/plugins/intel_gpu/tests/functional/single_layer_tests/dynamic/interpolate.cpp

+38
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,44 @@ INSTANTIATE_TEST_SUITE_P(InterpolateLinear_Layout_Test, InterpolateLayerGPUTest,
545545
::testing::Values(true, false)),
546546
InterpolateLayerGPUTest::getTestCaseName);
547547

548+
549+
const std::vector<ShapeParams> shapeParams4D_LargeShape = {
550+
ShapeParams{
551+
ov::op::v4::Interpolate::ShapeCalcMode::SCALES,
552+
InputShape{{-1, {2, 100}, -1, -1}, {{1, 64, 148, 148}}},
553+
//InputShape{{-1, -1, -1, -1}, {{1, 3, 48, 48}}}, // min shape for failure
554+
ov::test::utils::InputLayerType::CONSTANT,
555+
ov::test::utils::InputLayerType::CONSTANT,
556+
{{1.f, 1.f, 2.f, 2.f}},
557+
defaultAxes4D.front()
558+
},
559+
// ShapeParams{
560+
// ov::op::v4::Interpolate::ShapeCalcMode::SIZES,
561+
// InputShape{{-1, -1, -1, -1}, {{1, 3, 48, 48}}},
562+
// ov::test::utils::InputLayerType::CONSTANT,
563+
// ov::test::utils::InputLayerType::CONSTANT,
564+
// {{1, 3, 144, 144}},
565+
// defaultAxes4D.front()
566+
// },
567+
};
568+
569+
const auto interpolateCasesLinearOnnx_AlignCorners_Floor = ::testing::Combine(
570+
::testing::Values(ov::op::v4::Interpolate::InterpolateMode::LINEAR_ONNX),
571+
::testing::Values(ov::op::v4::Interpolate::CoordinateTransformMode::ALIGN_CORNERS),
572+
::testing::Values(ov::op::v4::Interpolate::NearestMode::FLOOR),
573+
::testing::ValuesIn(antialias),
574+
::testing::Values(std::vector<size_t>{0, 0, 0, 0}),
575+
::testing::Values(std::vector<size_t>{0, 0, 0, 0}),
576+
::testing::ValuesIn(cubeCoefs));
577+
578+
INSTANTIATE_TEST_SUITE_P(InterpolateLinearOnnx_LargeShape_Layout_Test, InterpolateLayerGPUTest,
579+
::testing::Combine(
580+
interpolateCasesLinearOnnx_AlignCorners_Floor,
581+
::testing::ValuesIn(shapeParams4D_LargeShape),
582+
::testing::Values(ov::element::f32),
583+
::testing::Values(true)),
584+
InterpolateLayerGPUTest::getTestCaseName);
585+
548586
const auto interpolateCasesCubic_Smoke = ::testing::Combine(
549587
::testing::Values(ov::op::v4::Interpolate::InterpolateMode::CUBIC),
550588
::testing::ValuesIn(coordinateTransformModes_Smoke),

0 commit comments

Comments
 (0)