| 330 | // Checks if we can rewrite a pattern to the `_Fused{Conv2D,MatMul}` on CPU. |
| 331 | template <typename Pattern> |
| 332 | bool IsCpuCompatible(const RemapperContext& ctx, const Pattern& matched) { |
| 333 | const NodeDef& node = ctx.graph_view.graph()->node(matched.contraction); |
| 334 | if (IsConv2D(node)) { |
| 335 | return IsCpuCompatibleConv2D(&node); |
| 336 | } else if (IsDepthwiseConv2dNative(node)) { |
| 337 | if (DisableMKL()) { |
| 338 | return false; |
| 339 | } |
| 340 | return IsCpuCompatibleDepthwiseConv2dNative(&node); |
| 341 | } else if (IsMatMul(node)) { |
| 342 | return IsCpuCompatibleMatMul(&node); |
| 343 | } else { |
| 344 | return false; |
| 345 | } |
| 346 | } |
| 347 | |
| 348 | // Checks if we can rewrite a pattern to the `_FusedConv2D` on GPU device. |
| 349 | bool IsGpuCompatible(const RemapperContext& ctx, |
no test coverage detected