Skip to content

Commit 1a2dfad

Browse files
committed
#include <map> added, example tests removed
1 parent 8cee16f commit 1a2dfad

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

tests/test-backend-ops.cpp

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include <string>
3939
#include <thread>
4040
#include <vector>
41+
#include <map>
4142

4243
static void init_tensor_uniform(ggml_tensor * tensor, float min = -1.0f, float max = 1.0f) {
4344
size_t nels = ggml_nelements(tensor);
@@ -5531,7 +5532,7 @@ static std::vector<std::unique_ptr<test_case>> make_test_cases_eval() {
55315532
}
55325533

55335534
// extra tests for im2col 2D
5534-
test_cases.emplace_back(new test_im2col(GGML_TYPE_F32, GGML_TYPE_F16, GGML_TYPE_F16, {12, 12, 1, 32}, {3, 4, 1, 32}, 1, 1, 1, 1, 1, 1, true));
5535+
test_cases.emplace_back(new test_im2col(GGML_TYPE_F32, GGML_TYPE_F16, GGML_TYPE_F16, {12, 12, 1, 32}, {3, 3, 1, 32}, 1, 1, 1, 1, 1, 1, true));
55355536
test_cases.emplace_back(new test_im2col(GGML_TYPE_F32, GGML_TYPE_F16, GGML_TYPE_F16, {12, 12, 2, 32}, {3, 3, 2, 32}, 1, 1, 1, 1, 1, 1, true));
55365537
test_cases.emplace_back(new test_im2col(GGML_TYPE_F32, GGML_TYPE_F16, GGML_TYPE_F16, {12, 12, 1, 1024}, {3, 3, 1, 1024}, 1, 1, 1, 1, 1, 1, true));
55375538
test_cases.emplace_back(new test_im2col(GGML_TYPE_F32, GGML_TYPE_F16, GGML_TYPE_F16, {12, 12, 2, 1024}, {3, 3, 2, 1024}, 1, 1, 1, 1, 1, 1, true));
@@ -5575,16 +5576,27 @@ static std::vector<std::unique_ptr<test_case>> make_test_cases_eval() {
55755576
};
55765577

55775578
for (auto act_case : cases) {
5578-
test_cases.emplace_back(new test_conv_2d(
5579-
{ act_case[iwh_idx], act_case[iwh_idx], act_case[Cin_idx], act_case[B_idx] },
5580-
{ act_case[kwh_idx], act_case[kwh_idx], act_case[Cin_idx], act_case[Cout_idx] }, 1, 1, 0, 0, 1, 1, false));
5581-
test_cases.emplace_back(new test_conv_2d_im2col(
5579+
test_cases.emplace_back(
5580+
new test_conv_2d({ act_case[iwh_idx], act_case[iwh_idx], act_case[Cin_idx], act_case[B_idx] },
5581+
{ act_case[kwh_idx], act_case[kwh_idx], act_case[Cin_idx], act_case[Cout_idx] },
5582+
1,
5583+
1,
5584+
0,
5585+
0,
5586+
1,
5587+
1,
5588+
false));
5589+
/*
5590+
// Example test for testing a composite op
5591+
test_cases.emplace_back(new test_conv_2d_im2col(
55825592
{ act_case[iwh_idx], act_case[iwh_idx], act_case[Cin_idx], act_case[B_idx] },
55835593
{ act_case[kwh_idx], act_case[kwh_idx], act_case[Cin_idx], act_case[Cout_idx] }, 1, 1, 0, 0, 1, 1, false));
5584-
test_cases.emplace_back(
5594+
// Example test for testing a regular op against a composite op
5595+
test_cases.emplace_back(
55855596
new test_conv_2d_compare({ act_case[iwh_idx], act_case[iwh_idx], act_case[Cin_idx], act_case[B_idx] },
55865597
{ act_case[kwh_idx], act_case[kwh_idx], act_case[Cin_idx], act_case[Cout_idx] }, 1,
55875598
1, 0, 0, 1, 1, false, true));
5599+
*/
55885600
}
55895601
#endif
55905602

@@ -5615,7 +5627,7 @@ static std::vector<std::unique_ptr<test_case>> make_test_cases_eval() {
56155627
test_cases.emplace_back(test_case_conv_2d);
56165628
auto test_case_conv_2d_im2col = new test_conv_2d_im2col(
56175629
{ W, H, Cin, 2 }, { KW, KH, Cin, Cout }, s0, s1, p0, p1, d0, d1, false);
5618-
test_cases.emplace_back(test_case_conv_2d_im2col);
5630+
//test_cases.emplace_back(test_case_conv_2d_im2col);
56195631
//test_cases.emplace_back(new test_conv_2d_compare(test_case_conv_2d, test_case_conv_2d_im2col);
56205632
}
56215633
}

0 commit comments

Comments
 (0)