class_docstr: Template kernels defined by CUDA / Cutlass in C++.
class_docstr_tok: ["Template","kernels","defined","by","CUDA","\/","Cutlass","in","C++","."]
docstr: Generates code to check that a node is not null.
docstr_tok: ["Generates","code","to","check","that","a","node","is","not","null","."]
code: def check_not_null(self, node: IRNode) -> str:
      """
      Generates code to check that a node is not null.
      """
  
      if node is None:
          return ""
  
      size_str = self.size(node, 0, -1)
      name_str = self.arg_name(node)
      if name_str is None:
          return ""
  
      res = IndentedBuffer(initial_indent=2)
      res.tabwidth = 1
      res.splice(
          f"""
              {{
                if (!{name_str}) {{
                  int64_t {name_str}_size = {size_str};
                  if ({name_str}_size > 0) {{
                    throw std::runtime_error("input {name_str} is null but size is not 0!");
                  }}
                }}
              }}
              """
      )
      return res.getvalue()
  
imports: import logging
  from typing import Callable, Dict, List, Optional, TYPE_CHECKING
  from ...None import ir
  from ...autotune_process import CUDABenchmarkRequest
  from ...ir import Buffer, CUDATemplateBuffer, IRNode, Layout, TensorBox
  from ...select_algorithm import ChoiceCaller
  from ...utils import sympy_product
  from ...virtualized import V
  from ..common import IndentedBuffer, Kernel, OpOverrides
  from ..cpp import CppPrinter, DTYPE_TO_CPP
label_desc: Use image node_id 3 for calling the CUDATemplateKernel obj's underlying member method code with example usage: obj.check_not_null(node) and returns: res, str, str