@@ -5555,7 +5555,7 @@ struct test_concat : public test_case {
55555555 const std::array<int64_t , 4 > ne_a;
55565556 const int64_t ne_b_d;
55575557 const int dim;
5558- const int v; // view (1 << 0: non-cont a, 1 << 1: non-cont b)
5558+ const int v; // view (1 << 0: non-cont a (first 3 dim) , 1 << 1: non-cont b (first 3 dim), 1 << 2: non-cont a (last 2 dim), 1 << 3: non-cont b (last 2 dim) )
55595559
55605560 std::string vars () override {
55615561 return VARS_TO_STR5 (type, ne_a, ne_b_d, dim, v);
@@ -5576,6 +5576,13 @@ struct test_concat : public test_case {
55765576 a = ggml_new_tensor (ctx, type, 4 , ne.data ());
55775577 ggml_set_name (a, " a" );
55785578
5579+ a = ggml_view_4d (ctx, a, ne_a[0 ], ne_a[1 ], ne_a[2 ], ne_a[3 ], a->nb [1 ], a->nb [2 ], a->nb [3 ], 0 );
5580+ ggml_set_name (a, " view_of_a" );
5581+ } else if (v & 4 ) {
5582+ auto ne = ne_a; ne[2 ] *= 2 ; ne[3 ] *= 4 ;
5583+ a = ggml_new_tensor (ctx, type, 4 , ne.data ());
5584+ ggml_set_name (a, " a" );
5585+
55795586 a = ggml_view_4d (ctx, a, ne_a[0 ], ne_a[1 ], ne_a[2 ], ne_a[3 ], a->nb [1 ], a->nb [2 ], a->nb [3 ], 0 );
55805587 ggml_set_name (a, " view_of_a" );
55815588 } else {
@@ -5588,6 +5595,13 @@ struct test_concat : public test_case {
55885595 b = ggml_new_tensor (ctx, type, 4 , ne.data ());
55895596 ggml_set_name (b, " b" );
55905597
5598+ b = ggml_view_4d (ctx, b, ne_b[0 ], ne_b[1 ], ne_b[2 ], ne_b[3 ], b->nb [1 ], b->nb [2 ], b->nb [3 ], 0 );
5599+ ggml_set_name (b, " view_of_b" );
5600+ } else if (v & 8 ) {
5601+ auto ne = ne_b; ne[2 ] *= 3 ; ne[3 ] *= 2 ;
5602+ b = ggml_new_tensor (ctx, type, 4 , ne.data ());
5603+ ggml_set_name (b, " b" );
5604+
55915605 b = ggml_view_4d (ctx, b, ne_b[0 ], ne_b[1 ], ne_b[2 ], ne_b[3 ], b->nb [1 ], b->nb [2 ], b->nb [3 ], 0 );
55925606 ggml_set_name (b, " view_of_b" );
55935607 } else {
@@ -9089,8 +9103,10 @@ static std::vector<std::unique_ptr<test_case>> make_test_cases_eval() {
90899103 }
90909104
90919105 for (ggml_type type_a : { GGML_TYPE_Q4_0 , GGML_TYPE_Q4_1 , GGML_TYPE_Q5_0 , GGML_TYPE_Q5_1 , GGML_TYPE_Q8_0 }) {
9092- for (int dim : { 0 , 1 , 2 , 3 , }) {
9093- test_cases.emplace_back (new test_concat (type_a, {128 , 12 , 13 , 14 }, dim == 0 ? 256 : 7 , dim, 0 ));
9106+ for (int v : { 0 , 4 , 8 , 12 }) {
9107+ for (int dim : { 0 , 1 , 2 , 3 , }) {
9108+ test_cases.emplace_back (new test_concat (type_a, {128 , 12 , 13 , 14 }, dim == 0 ? 256 : 7 , dim, v));
9109+ }
90949110 }
90959111 }
90969112
0 commit comments