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

Function TEST_CASE

tests/validation/CL/MatMulLowpNativeMMULKernel.cpp:75–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73TEST_SUITE(Validate)
74
75TEST_CASE(SupportedKernelConfigurations, framework::DatasetMode::ALL)
76{
77 using MatMulConfigurationPair = std::pair<MatMulKernelInfo, bool>;
78
79 const std::vector<MatMulConfigurationPair> supported_block_sizes = {
80 // MatMulKernelInfo(adj_lhs, adj_rhs, M0, N0, K0, export_rhs_to_cl_image = false)
81 {MatMulKernelInfo(false, false, 0, 1, 4), false}, // M0 should be > 0
82 {MatMulKernelInfo(false, true, 3, 5, 4), false}, // N0 not in {1, 2, 3, 4, 8, 16}
83 {MatMulKernelInfo(false, false, 3, 6, 4), false}, // N0 not in {1, 2, 3, 4, 8, 16}
84 {MatMulKernelInfo(false, false, 3, 3, 8), false}, // K0 not in 4
85 {MatMulKernelInfo(true, false, 5, 3, 4), false}, // M0 not in {1, 2, 3, 4, 8, 16} when Lhs is transposed
86 {MatMulKernelInfo(false, false, 9, 1, 4), true},
87 {MatMulKernelInfo(false, true, 3, 16, 4), true},
88 {MatMulKernelInfo(false, false, 7, 3, 4), true},
89 {MatMulKernelInfo(true, false, 8, 3, 4), true},
90 {MatMulKernelInfo(true, true, 4, 3, 4), true},
91 {MatMulKernelInfo(false, false, 7, 3, 4, true), false}, // export to CLImage is unsupported for quantized types
92 };
93
94 // Set big enough shapes so that block sizes are not truncated. Also, set all dimensions equal
95 // so that it doesn't fail for different NT/T configurations. We aim to test the block sizes here,
96 // not the shapes themselves.
97 const TensorInfo lhs_info = TensorInfo(TensorShape(64U, 64U), 1, DataType::QASYMM8_SIGNED);
98 const TensorInfo rhs_info = TensorInfo(TensorShape(64U, 64U), 1, DataType::QASYMM8_SIGNED);
99
100 for (auto &pair : supported_block_sizes)
101 {
102 TensorInfo output_info;
103 Status status = ClMatMulLowpNativeMMULKernel::validate(&lhs_info, &rhs_info, nullptr, &output_info, pair.first);
104 const bool expected = (pair.second && arm_matrix_multiply_supported(CLKernelLibrary::get().get_device()));
105
106 ARM_COMPUTE_EXPECT(bool(status) == expected, framework::LogLevel::ERRORS);
107 }
108}
109
110TEST_CASE(ValidateInputShapes, framework::DatasetMode::ALL)
111{

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected