class_docstr: CUTLASS GEMM template, which is used to generate CUTLASS GEMM kernels
  including those which allow flexible fusions with epilogues.
class_docstr_tok: ["CUTLASS","GEMM","template",",","which","is","used","to","generate","CUTLASS","GEMM","kernels","including","those","which","allow","flexible","fusions","with","epilogues","."]
code: def filter_op(
      self,
      op: "cutlass_library.gemm_op.GemmOperation",  # type: ignore[name-defined]  # noqa: F821
  ) -> "cutlass_library.gemm_op.GemmOperation":  # type: ignore[name-defined]  # noqa: F821
      assert cutlass_utils.try_import_cutlass()
      import cutlass_library.library as cutlass_lib
  
      # Skip simt kernels
      if (
          op.tile_description.math_instruction.opcode_class
          == cutlass_lib.OpcodeClass.Simt
      ):
          return None
  
      # Only keep GemmUniversal kernels
      if op.gemm_kind not in {
          cutlass_lib.GemmKind.Universal,
          cutlass_lib.GemmKind.Universal3x,
      }:
          return None
      # Filter ops by dtypes.
      X = self.input_nodes[0]
      W = self.input_nodes[1]
      accumulator_torch_dtype = cutlass_utils.get_accumulator_dtype(
          [X.get_dtype(), W.get_dtype()],
      )
      if not (
          cutlass_utils.dtype_match(X.get_dtype(), op.A.element)
          and cutlass_utils.dtype_match(W.get_dtype(), op.B.element)
          and cutlass_utils.dtype_match(
              self.output_node.get_layout().dtype, op.C.element
          )
          and cutlass_utils.dtype_match(
              accumulator_torch_dtype, op.accumulator_type()
          )
      ):
          return None
  
      # Filter ops by input layouts.
      if not (
          self.layout_match(X.get_layout(), op.A.layout)
          and self.layout_match(W.get_layout(), op.B.layout)
      ):
          return None
  
      # Update op.
      op = copy.deepcopy(op)
  
      # Set output layout.
      op.D.layout = CUTLASSGemmTemplate.cutlass_layout(
          self.output_node.get_layout()
      )
  
      # Filter ops by alignments and set alignments.
      if not (
          self.set_alignment(X.get_layout(), op.A)
          and self.set_alignment(W.get_layout(), op.B)
          and self.set_alignment(self.output_node.get_layout(), op.D)
      ):
          return None
  
      # Set epilogue.
      # TODO: update epilogue functor according to epilogues.
      op.element_epilogue = op.accumulator_type()
  
      # Set bias layout and alignment.
      if len(self.input_nodes) >= 3 and self.input_nodes[2] is not None:
          Bias = self.input_nodes[2]
          bias_layout = CUTLASSGemmTemplate.cutlass_layout(
              Bias.get_layout()
          )
          if op.gemm_kind != cutlass_lib.GemmKind.Universal3x:
              if bias_layout != op.D.layout:
                  # For cutlass2, bias and output layout must match
                  return None
          else:
              op.C.layout = bias_layout
          if not self.set_alignment(Bias.get_layout(), op.C):
              return None
      else:
          if op.gemm_kind == cutlass_lib.GemmKind.Universal3x:
              op.C.element = cutlass_lib.DataType.void
          else:
              op.C.layout = op.D.layout
      supports_evt: bool = self.supports_evt(op)
      if (self.can_fuse_epilogue is not None) and (
          self.can_fuse_epilogue != supports_evt
      ):
          return None
      if (
          inductor_cuda_config.cutlass_only_evt_capable_ops
          and not supports_evt
      ):
          return None
      return op
  
imports: import copy
  import logging
  import re
  from typing import cast, Dict, List, Optional, Tuple
  from ...config import cuda
  from ...ir import Buffer, CUDATemplateBuffer, FixedLayout, IRNode, Layout
  from ..common import IndentedBuffer
  from .None import cutlass_utils
  from .cuda_kernel import CUDATemplateKernel
  from .cuda_template import CUTLASSTemplate
  from .cutlass_epilogue_gen import CutlassEVTEpilogueArgumentFormatter, CutlassEVTEpilogueTypeFormatter
label_desc: Use image node_id 14 for calling the CUTLASSGemmTemplate obj's underlying member method code with example usage: obj.filter_op(op) and returns: op, None, None, None, None, None, None, None, None, None