code: def reduce(env, exec_policy, first, last, init=None, binary_op=None):
      """Generalization of summation."""
      _assert_exec_policy_type(exec_policy)
      _assert_pointer_type(first)
      _assert_same_type(first, last)
      args = [exec_policy, first, last]
      if init is not None:
          # TODO(asi1024): Typecheck for init.
          args.append(init)
          return_type = init.ctype
      else:
          return_type = first.ctype.child_type
      if binary_op is not None:
          raise NotImplementedError("binary_op option is not supported")
      params = ", ".join([a.code for a in args])
      return _Data(f"thrust::reduce({params})", return_type)
  
imports: from cupyx.jit import _internal_types
  from cupyx.jit import _cuda_types
  from cupyx.jit._internal_types import Data
label_desc: Use image node_id 27 for calling a global function with example usage: reduce(env, exec_policy, first, last, init, binary_op) and returns: _Data