Skip to content

Commit

Permalink
Update unittest to reduce the number of test
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinchoi-intel committed Dec 4, 2024
1 parent bac20a6 commit 247a48a
Showing 1 changed file with 2 additions and 59 deletions.
61 changes: 2 additions & 59 deletions src/plugins/intel_gpu/tests/unit/test_cases/pooling_gpu_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1517,63 +1517,6 @@ TEST(pooling_forward_gpu, b_fs_yx_fsv4)
} // for (int j = 0; F_array[j]; i++)
}

TEST(pooling_forward_gpu, fs_b_yx_fsv32_int8)
{
auto& engine = get_test_engine();

auto input_prim = engine.allocate_memory({ data_types::f32, format::yxfb, { 2, 32, 1, 2 } });

topology topology;
topology.add(input_layout("input", input_prim->get_layout()));
topology.add(reorder("reorder_input", input_info("input"), layout(data_types::i8, format::fs_b_yx_fsv32, { 2, 32, 1, 2 })));
topology.add(pooling("avg_pooling", input_info("reorder_input"), pooling_mode::average, { 7, 7 }, { 2, 2 }));
topology.add(reorder("reorder_after_pooling", input_info("avg_pooling"), layout(data_types::f32, format::fs_b_yx_fsv32, { 2, 32, 1, 1 })));

network network(engine, topology, get_test_default_config(engine));
set_values(input_prim, { 41.f, 42.f, 43.f, 44.f, 45.f, 46.f, 47.f, 48.f,
11.f, 12.f, 13.f, 14.f, 15.f, 16.f, 17.f, 18.f,
21.f, 22.f, 23.f, 24.f, 25.f, 26.f, 27.f, 28.f,
31.f, 32.f, 33.f, 34.f, 35.f, 36.f, 37.f, 38.f,

31.f, 32.f, 33.f, 34.f, 35.f, 36.f, 37.f, 38.f,
21.f, 22.f, 23.f, 24.f, 25.f, 26.f, 27.f, 28.f,
51.f, 52.f, 53.f, 54.f, 55.f, 56.f, 57.f, 58.f,
11.f, 12.f, 13.f, 14.f, 15.f, 16.f, 17.f, 18.f,

41.f, 42.f, 43.f, 44.f, 45.f, 46.f, 47.f, 48.f,
11.f, 12.f, 13.f, 14.f, 15.f, 16.f, 17.f, 18.f,
21.f, 22.f, 23.f, 24.f, 25.f, 26.f, 27.f, 28.f,
31.f, 32.f, 33.f, 34.f, 35.f, 36.f, 37.f, 38.f,

31.f, 32.f, 33.f, 34.f, 35.f, 36.f, 37.f, 38.f,
21.f, 22.f, 23.f, 24.f, 25.f, 26.f, 27.f, 28.f,
51.f, 52.f, 53.f, 54.f, 55.f, 56.f, 57.f, 58.f,
11.f, 12.f, 13.f, 14.f, 15.f, 16.f, 17.f, 18.f });
network.set_input_data("input", input_prim);

auto outputs = network.execute();
ASSERT_EQ(outputs.size(), size_t(1));
ASSERT_EQ(outputs.begin()->first, "reorder_after_pooling");

auto output_prim = outputs.begin()->second.get_memory();

cldnn::mem_lock<float> output_ptr(output_prim, get_test_stream());

std::vector<float> ref_data = { 41.f, 43.f, 45.f, 47.f, 11.f, 13.f, 15.f, 17.f,
21.f, 23.f, 25.f, 27.f, 31.f, 33.f, 35.f, 37.f,
31.f, 33.f, 35.f, 37.f, 21.f, 23.f, 25.f, 27.f,
51.f, 53.f, 55.f, 57.f, 11.f, 13.f, 15.f, 17.f,

42.f, 44.f, 46.f, 48.f, 12.f, 14.f, 16.f, 18.f,
22.f, 24.f, 26.f, 28.f, 32.f, 34.f, 36.f, 38.f,
32.f, 34.f, 36.f, 38.f, 22.f, 24.f, 26.f, 28.f,
52.f, 54.f, 56.f, 58.f, 12.f, 14.f, 16.f, 18.f };

for (size_t i = 0; i < ref_data.size(); i++) {
ASSERT_EQ(ref_data[i], float(output_ptr[i]));
}
}

TEST(pooling_forward_gpu, fs_b_yx_fsv32_avg_3x3_input_2x2_pool_1x1_stride_2x2_output)
{
auto& engine = get_test_engine();
Expand Down Expand Up @@ -2360,8 +2303,8 @@ INSTANTIATE_TEST_SUITE_P(
pooling_random_test_int8_uint8,
testing::Combine(testing::Values(1, 2),
testing::Values(3, 8),
testing::Values(std::tuple<size_t, size_t, size_t>(12, 12, 1), std::tuple<size_t, size_t, size_t>(24, 24, 1)),
testing::Values(std::tuple<size_t, size_t, size_t>(4, 4, 1), std::tuple<size_t, size_t, size_t>(2, 2, 1)),
testing::Values(std::tuple<size_t, size_t, size_t>(12, 12, 1)),
testing::Values(std::tuple<size_t, size_t, size_t>(4, 4, 1)),
testing::Values(std::tuple<int, int, int>(2, 2, 1)),
testing::Values(std::tuple<int, int, int>(0, 0, 0)),
testing::Values(format::fs_b_yx_fsv32)),
Expand Down

0 comments on commit 247a48a

Please sign in to comment.