| 50 | } |
| 51 | |
| 52 | Status ClMatMul::validate(const ITensorInfo *lhs, |
| 53 | const ITensorInfo *rhs, |
| 54 | const ITensorInfo *dst, |
| 55 | const MatMulInfo &matmul_info, |
| 56 | const ActivationLayerInfo &act_info) |
| 57 | { |
| 58 | ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(lhs, rhs, dst); |
| 59 | ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(lhs, 1, DataType::QASYMM8, DataType::QASYMM8_SIGNED, |
| 60 | DataType::F16, DataType::F32); |
| 61 | ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(rhs, 1, DataType::QASYMM8, DataType::QASYMM8_SIGNED, |
| 62 | DataType::F16, DataType::F32); |
| 63 | |
| 64 | const GPUTarget gpu_target = CLScheduler::get().target(); |
| 65 | |
| 66 | std::unique_ptr<IClMatMulNativeKernelConfig> t = ClMatMulNativeKernelConfigurationFactory::create(gpu_target); |
| 67 | |
| 68 | const MatMulKernelInfo kernel_info = t->configure(lhs, rhs, matmul_info); |
| 69 | |
| 70 | const auto kernel_selector = ClMatMulNativeKernelVariantFactory::create(gpu_target); |
| 71 | const MatMulKernelType kernel_type = kernel_selector->select_kernel(lhs, rhs, matmul_info, act_info); |
| 72 | |
| 73 | switch (kernel_type) |
| 74 | { |
| 75 | case MatMulKernelType::NATIVE_FP: |
| 76 | return ClMatMulNativeKernel::validate(lhs, rhs, nullptr /* bias */, dst, kernel_info, act_info); |
| 77 | case MatMulKernelType::NATIVE_MMUL_FP: |
| 78 | return ClMatMulNativeMMULKernel::validate(lhs, rhs, nullptr /* bias */, dst, kernel_info); |
| 79 | case MatMulKernelType::NATIVE_QUANTIZED: |
| 80 | return ClMatMulLowpNativeKernel::validate(lhs, rhs, nullptr /* bias */, dst, kernel_info, act_info); |
| 81 | case MatMulKernelType::NATIVE_MMUL_QUANTIZED: |
| 82 | return ClMatMulLowpNativeMMULKernel::validate(lhs, rhs, nullptr /* bias */, dst, kernel_info, act_info); |
| 83 | default: |
| 84 | ARM_COMPUTE_ERROR("Unsupported MatMul Kernel!"); |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | void ClMatMul::configure(const CLCompileContext &compile_context, |
| 89 | ITensorInfo *lhs, |
nothing calls this directly
no test coverage detected