KleidiAI Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 92.3% 12 / 0 / 13
Functions: 100.0% 4 / 0 / 4
Branches: 50.0% 7 / 0 / 14

test/nextgen/operators/matmul/pack_lhs/matmul_pack_lhs_wrapper.cpp
Line Branch Exec Source
1 //
2 // SPDX-FileCopyrightText: Copyright 2025 Arm Limited and/or its affiliates <open-source-office@arm.com>
3 //
4 // SPDX-License-Identifier: Apache-2.0
5 //
6
7 #include "test/nextgen/operators/matmul/pack_lhs/matmul_pack_lhs_wrapper.hpp"
8
9 #include <array>
10 #include <memory>
11 #include <string>
12 #include <string_view>
13
14 #include "kai/ukernels/matmul/pack/kai_lhs_quant_pack_qai8dxp_f32.h"
15 #include "test/common/data_type.hpp"
16 #include "test/common/sme.hpp"
17 #include "test/nextgen/common/poly.hpp"
18 #include "test/nextgen/format/block2d_row_format.hpp"
19 #include "test/nextgen/format/plain_format.hpp"
20 #include "test/nextgen/harness/kernel_wrapper.hpp"
21 #include "test/nextgen/operators/matmul/pack_lhs/matmul_pack_lhs_dq_wrapper.hpp"
22 #include "test/nextgen/operators/matmul/pack_lhs/matmul_pack_lhs_interface.hpp"
23
24 namespace kai::test {
25
26 namespace {
27
28 6 std::unique_ptr<KernelWrapper> create_matmul_lhs_quant_pack_qai8dxp_f32(
29 std::string_view block_name, size_t block_height, size_t block_width) {
30
1/2
✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
12 return std::make_unique<MatMulPackLhsDqWrapper>(
31
3/6
✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
6 "matmul_lhs_quant_pack_qai8dxp" + std::string(block_name) + "_f32",
32 6 MatMulPackLhsDqInterface{
33 kai_get_m_step_lhs_quant_pack_qai8dxp_f32,
34 kai_get_lhs_offset_lhs_quant_pack_qai8dxp_f32,
35 kai_get_lhs_packed_offset_lhs_quant_pack_qai8dxp_f32,
36 kai_get_lhs_packed_size_lhs_quant_pack_qai8dxp_f32,
37 kai_run_lhs_quant_pack_qai8dxp_f32,
38 },
39
1/2
✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
6 make_poly<PlainFormat>(DataType::FP32),
40
2/4
✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 3 not taken.
12 make_poly<Block2dRowFormat>(
41 6 block_height, block_width, 32, true, DataType::I8, std::array<DataType, 0>{},
42 6 std::array{DataType::I32, DataType::FP32}));
43 }
44
45 } // namespace
46
47 3 std::unique_ptr<KernelWrapper> create_matmul_lhs_quant_pack_qai8dxp1vlx4_f32() {
48 3 return create_matmul_lhs_quant_pack_qai8dxp_f32("1vlx4", 1 * get_sme_vector_length<float>(), 4);
49 }
50
51 3 std::unique_ptr<KernelWrapper> create_matmul_lhs_quant_pack_qai8dxp1x4_f32() {
52 3 return create_matmul_lhs_quant_pack_qai8dxp_f32("1x4", 1, 4);
53 }
54
55 } // namespace kai::test
56