class_docstr: A device function for single elementwise operations.
      
docstr: Returns a CUDA device function code.
  
  Returns a string like:
  ```
  __device__ void cupy_add_0(int &in0_, float &in1_, double &out0_) {
      typedef double in0_type;
      typedef double in1_type;
      typedef double out0_type;
      double in0 = (double) in0_;
      double in1 = (double) in1_;
      double out0 = (double) out0_;
      out0 = in0 + in1;
      out0_ = out0;
  }
  ```
docstr_tok: ["Returns","a","CUDA","device","function","code",".","Returns","a","string","like",":","``","`","__device__","void","cupy_add_0","(","int","&","in0_",",","float","&","in1_",",","double","&","out0_",")","{","typedef","double","in0_type",";","typedef","double","in1_type",";","typedef","double","out0_type",";","double","in0","=","(","double",")","in0_",";","double","in1","=","(","double",")","in1_",";","double","out0","=","(","double",")","out0_",";","out0","=","in0","+","in1",";","out0_","=","out0",";","}","``","`"]
code: def emit_code(self):
      """Returns a CUDA device function code.
  
      Returns a string like:
      ```
      __device__ void cupy_add_0(int &in0_, float &in1_, double &out0_) {
          typedef double in0_type;
          typedef double in1_type;
          typedef double out0_type;
          double in0 = (double) in0_;
          double in1 = (double) in1_;
          double out0 = (double) out0_;
          out0 = in0 + in1;
          out0_ = out0;
      }
      ```
      """
      nin = len(self.in_params)
      dtypes = self.compute_dtypes
      assert len(self.in_params) == len(self.compute_dtypes[:nin])
      in_params = [
          (get_typename(p.dtype), get_typename(t), "in{}".format(i))
          for i, (p, t) in enumerate(zip(self.in_params, dtypes[:nin]))
      ]
      out_params = [
          (get_typename(p.dtype), get_typename(t), "out{}".format(i))
          for i, (p, t) in enumerate(zip(self.out_params, dtypes[nin:]))
      ]
      params = in_params + out_params
  
      params_code = ", ".join(
          ["{} &{}_".format(t, s) for t, _, s in params]
      )
      typedef = [
          "typedef {} {}_type;".format(t, s) for _, t, s in params
      ]
      read = [
          "{} {} = ({}) {}_;".format(t, s, t, s) for _, t, s in params
      ]
      write = ["{}_ = {};".format(s, s) for _, _, s in out_params]
  
      return _codeblock.CodeBlock(
          "__device__ void {}({})".format(self.name, params_code),
          typedef + read + [self.routine_code + ";"] + write,
      )
  
imports: import string
  import numpy
  from cupy._core import _codeblock
  from cupy._core._fusion_variable import _TraceVariable
  from cupy._core._fusion_variable import _TraceArray
  from cupy._core._fusion_variable import _VariableSet
  from cupy._core import _fusion_thread_local
  from cupy._core import _kernel
  from cupy._core import _reduction
  from cupy._core._scalar import get_typename
label_desc: Use image node_id 2 for calling the _UfuncRoutine obj's underlying member method code with example usage: obj.emit_code() and returns: _codeblock