code: def test_reduce_map(in_shape, axis, keepdims, type="sum", test_id=0):
      global TASK
      # Build the logic and compile the function
      A = te.placeholder(shape=in_shape, name="A")
      if type == "sum":
          TASK = "sum_map_id%d" % test_id
          B = topi.sum(A, axis=axis, keepdims=keepdims)
      elif type == "max":
          TASK = "max_map_id%d" % test_id
          B = topi.max(A, axis=axis, keepdims=keepdims)
      elif type == "min":
          TASK = "min_map_id%d" % test_id
          B = topi.min(A, axis=axis, keepdims=keepdims)
      else:
          raise NotImplementedError
      s = topi.cuda.schedule_reduce(B)
      with tvm.transform.PassContext(
          config={
              "tir.UnrollLoop": {
                  "auto_max_step": 16,
              }
          }
      ):
          fcuda = tvm.build(s, [A, B], "cuda", name="sum")
  
      # Test
      in_npy = np.random.normal(size=in_shape).astype(np.float32)
      if type == "sum":
          out_npy = in_npy.sum(axis=axis, keepdims=keepdims)
      elif type == "max":
          out_npy = in_npy.max(axis=axis, keepdims=keepdims)
      elif type == "min":
          out_npy = in_npy.min(axis=axis, keepdims=keepdims)
      else:
          raise NotImplementedError
  
      data_tvm = tvm.nd.array(in_npy, device=tvm.cuda())
      out_tvm = tvm.nd.empty(shape=out_npy.shape, device=tvm.cuda())
  
      for _ in range(2):
          fcuda(data_tvm, out_tvm)
      tvm.testing.assert_allclose(
          out_tvm.numpy(), out_npy, rtol=4e-4, atol=4e-4
      )
  
file_path: tvm/apps/topi_recipe/reduce/test_reduce_map.py
imports: import os
  import numpy
  import tvm
  from tvm import te, topi
  from tvm.contrib import nvcc
label_desc: Use image node_id 3 for calling a global function with example usage: test_reduce_map(in_shape, axis, keepdims, type, test_id) without return types