@@ -2422,6 +2422,32 @@ struct test_clamp : public test_case {
24222422 }
24232423};
24242424
2425+ // GGML_OP_FILL
2426+ struct test_fill : public test_case {
2427+ const ggml_type type;
2428+ const std::array<int64_t , 4 > ne;
2429+ float v;
2430+
2431+ std::string vars () override {
2432+ return VARS_TO_STR3 (type, ne, v);
2433+ }
2434+
2435+ test_fill (ggml_type type = GGML_TYPE_F32,
2436+ std::array<int64_t , 4 > ne = {10 , 5 , 4 , 3 },
2437+ float v = 0 .5f )
2438+ : type(type), ne(ne), v(v) {}
2439+
2440+ ggml_tensor * build_graph (ggml_context * ctx) override {
2441+ ggml_tensor * a = ggml_new_tensor (ctx, type, 4 , ne.data ());
2442+ ggml_set_name (a, " a" );
2443+
2444+ ggml_tensor * out = ggml_fill (ctx, a, v);
2445+ ggml_set_name (out, " out" );
2446+
2447+ return out;
2448+ }
2449+ };
2450+
24252451// GGML_OP_DIAG_MASK_INF
24262452struct test_diag_mask_inf : public test_case {
24272453 const ggml_type type;
@@ -4199,6 +4225,8 @@ static std::vector<std::unique_ptr<test_case>> make_test_cases_eval() {
41994225 test_cases.emplace_back (new test_gla (GGML_TYPE_F32, 32 , 64 , 32 , 4 ));
42004226 test_cases.emplace_back (new test_gla (GGML_TYPE_F32, 32 , 64 , 128 , 4 ));
42014227
4228+ test_cases.emplace_back (new test_fill (GGML_TYPE_F32));
4229+
42024230 for (ggml_type type_a : all_types) {
42034231 for (int i = 1 ; i < 10 ; ++i) {
42044232 test_cases.emplace_back (new test_mul_mat (type_a, GGML_TYPE_F32, 16 , i, 256 , { 1 , 1 }, {1 , 1 }));
0 commit comments