| 9 | namespace BareMetal { |
| 10 | |
| 11 | bool TopkKernel::IsAvailable(TContext* ctx) const { |
| 12 | bool ok_dtype = ctx->getAttrOprand("operand:0").dtype == "f32" || |
| 13 | ctx->getAttrOprand("operand:0").dtype == "f16"; |
| 14 | bool ok_mode = ctx->getAttrStr("mode") == "KTH_ONLY" || |
| 15 | ctx->getAttrStr("mode") == "VALUE_IDX_SORTED" || |
| 16 | ctx->getAttrStr("mode") == "VALUE_IDX_NOSORT"; |
| 17 | return ok_dtype && ok_mode; |
| 18 | } |
| 19 | |
| 20 | namespace { |
| 21 | void get_mode_bool(bool& with_index, bool& only_kth, TContext* ctx) { |
nothing calls this directly
no test coverage detected