| 11 | using namespace BareMetal; |
| 12 | |
| 13 | bool MatrixMulKernel::IsAvailable(TContext* context) const { |
| 14 | bool ok_dtype = context->getAttrOprand("operand:0").dtype == "f32" && |
| 15 | context->getAttrOprand("operand:1").dtype == "f32" && |
| 16 | context->getAttrOprand("operand:2").dtype == "f32"; |
| 17 | bool ok_fp16 = context->getAttrOprand("operand:0").dtype == "f16" && |
| 18 | context->getAttrOprand("operand:1").dtype == "f16" && |
| 19 | context->getAttrOprand("operand:2").dtype == "f16"; |
| 20 | bool ok_mode = context->getAttrStr("format") == "DEFAULT" && |
| 21 | context->getAttrStr("compute_mode") == "DEFAULT"; |
| 22 | return (ok_dtype || ok_fp16) && ok_mode; |
| 23 | } |
| 24 | |
| 25 | //! kernel gen |
| 26 | std::string MatrixMulKernel::GetKernelSymbol(TContext* context) const { |
nothing calls this directly
no test coverage detected