code: def _make_unary_array_func(name):
      def f(array, stream_or_out=None, **kwargs):
          if stream_or_out is not None:
              warnings.warn(
                  "please use 'out' or 'stream' keyword arguments",
                  DeprecationWarning,
              )
              if isinstance(stream_or_out, Stream):
                  stream = stream_or_out
                  out = None
              else:
                  stream = None
                  out = stream_or_out
  
          out, stream = None, None
          if "out" in kwargs:
              out = kwargs["out"]
          if "stream" in kwargs:
              stream = kwargs["stream"]
  
          if array.dtype == np.float32:
              func_name = name + "f"
          else:
              func_name = name
  
          if not array.flags.forc:
              raise RuntimeError(
                  "only contiguous arrays may "
                  "be used as arguments to this operation"
              )
  
          if out is None:
              out = array._new_like_me()
          else:
              assert out.dtype == array.dtype
              assert out.strides == array.strides
              assert out.shape == array.shape
  
          func = elementwise.get_unary_func_kernel(
              func_name, array.dtype
          )
          func.prepared_async_call(
              array._grid,
              array._block,
              stream,
              array.gpudata,
              out.gpudata,
              array.mem_size,
          )
  
          return out
  
      return f
  
file_path: pycuda/pycuda/cumath.py
imports: import pycuda.gpuarray
  import pycuda.elementwise
  import numpy
  import warnings
  from pycuda.driver import Stream
label_desc: Use image node_id 1 for calling a global function with example usage: _make_unary_array_func(name) and returns: f, out