MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / TEST_CASE

Function TEST_CASE

tests/validation/CL/MatMulNativeMMULKernel.cpp:84–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82TEST_SUITE(Validate)
83
84TEST_CASE(SupportedBlockSizes, framework::DatasetMode::ALL)
85{
86 if (arm_matrix_multiply_supported(CLKernelLibrary::get().get_device()))
87 {
88 using MatMulConfigurationPair = std::pair<MatMulKernelInfo, bool>;
89
90 const std::vector<MatMulConfigurationPair> supported_block_sizes = {
91 // MatMulKernelInfo(adj_lhs, adj_rhs, M0, N0, K0, export_rhs_to_cl_image = false)
92 // Lhs not-transposed, Rhs not-transposed
93 {MatMulKernelInfo(false, false, 0, 1, 1), false}, // M0 should be > 0
94 {MatMulKernelInfo(false, false, 3, 5, 1), false}, // N0 not in {1, 2, 3, 4, 8, 16}
95 {MatMulKernelInfo(false, false, 3, 6, 1), false}, // N0 not in {1, 2, 3, 4, 8, 16}
96 {MatMulKernelInfo(false, false, 3, 3, 4), false}, // K0 not 1
97 {MatMulKernelInfo(false, false, 9, 1, 1), true},
98 {MatMulKernelInfo(false, false, 3, 16, 1), true},
99 {MatMulKernelInfo(false, false, 7, 3, 1), true},
100
101 // Lhs transposed, Rhs not-transposed
102 {MatMulKernelInfo(true, false, 3, 11, 1), false}, // N0 not in {1, 2, 3, 4, 8, 16}
103 {MatMulKernelInfo(true, false, 3, 7, 1), false}, // N0 not in {1, 2, 3, 4, 8, 16}
104 {MatMulKernelInfo(true, false, 6, 3, 1), false}, // M0 not in {1, 2, 3, 4, 8, 16}
105 {MatMulKernelInfo(true, false, 5, 3, 1), false}, // M0 not in {1, 2, 3, 4, 8, 16}
106 {MatMulKernelInfo(true, false, 2, 2, 2), false}, // K0 is not 1
107 {MatMulKernelInfo(true, false, 4, 1, 1), true},
108 {MatMulKernelInfo(true, false, 3, 3, 1), true},
109 {MatMulKernelInfo(true, false, 2, 4, 1), true},
110
111 // Lhs not-transposed, Rhs not-transposed
112 {MatMulKernelInfo(false, true, 3, 11, 1), false}, // N0 not in {1, 2, 3, 4, 8}
113 {MatMulKernelInfo(false, true, 2, 17, 1), false}, // N0 not in {1, 2, 3, 4, 8}
114 {MatMulKernelInfo(false, true, 4, 5, 1), false}, // N0 not in {1, 2, 3, 4, 8}
115 {MatMulKernelInfo(false, true, 4, 4, 7), false}, // K0 is not 1
116 {MatMulKernelInfo(false, true, 4, 7, 1), false}, // N0 not in {1, 2, 3, 4, 8}
117 {MatMulKernelInfo(false, true, 3, 8, 1), true},
118 {MatMulKernelInfo(false, true, 8, 16, 1), true},
119 {MatMulKernelInfo(false, true, 2, 4, 1), true},
120
121 // Lhs transposed, Rhs transposed
122 {MatMulKernelInfo(true, true, 3, 11, 1), false}, // N0 not in {1, 2, 3, 4, 8, 16}
123 {MatMulKernelInfo(true, true, 3, 7, 1), false}, // N0 not in {1, 2, 3, 4, 8, 16}
124 {MatMulKernelInfo(true, true, 6, 3, 1), false}, // M0 not in {1, 2, 3, 4, 8, 16}
125 {MatMulKernelInfo(true, true, 5, 3, 1), false}, // M0 not in {1, 2, 3, 4, 8, 16}
126 {MatMulKernelInfo(true, true, 4, 8, 2), false}, // K0 is not 1
127 {MatMulKernelInfo(true, true, 4, 8, 1), true},
128 {MatMulKernelInfo(true, true, 3, 3, 1), true},
129 {MatMulKernelInfo(true, true, 16, 4, 1), true},
130 };
131
132 // Set big enough shapes so that block sizes are not truncated. Also, set all dimensions equal
133 // so that it doesn't fail for different NT/T configurations. We aim to test the block sizes here,
134 // not the shapes themselves.
135 const TensorInfo lhs_info = TensorInfo(TensorShape(100U, 100U), 1, DataType::F32);
136 const TensorInfo rhs_info = TensorInfo(TensorShape(100U, 100U), 1, DataType::F32);
137
138 for (auto &pair : supported_block_sizes)
139 {
140 TensorInfo output_info;
141 Status status = ClMatMulNativeMMULKernel::validate(&lhs_info, &rhs_info, nullptr, &output_info, pair.first);

Callers

nothing calls this directly

Calls 7

MatMulKernelInfoClass · 0.50
TensorInfoClass · 0.50
TensorShapeClass · 0.50
validateFunction · 0.50
permuteFunction · 0.50

Tested by

no test coverage detected