code: def test_fanout(algorithm, workspace_size):
      """
      The test case here represent BufferInfo objects
      that could get generated for a fanout topology
      such as :
      (Op A)
      |
      bi_a ---------
      |            |
      (Op B)     (Op C)
      |            |
      bi_b        bi_c
      |            |
      (Op D)     (Op E)
      |            |
      bi_d        bi_e
      |            |
      (Op F) ------
      |
      bi_f
      |
      (Op G)
      |
      bi_g
      """
      target = Target("c")
      global_workspace_pool = WorkspacePoolInfo(
          "global_workspace",
          targets=[target],
      )
      bi_a = usmp_utils.BufferInfo(
          name_hint="bi_a",
          size_bytes=10,
          pool_candidates=[global_workspace_pool],
      )
      bi_b = usmp_utils.BufferInfo(
          name_hint="bi_b",
          size_bytes=20,
          pool_candidates=[global_workspace_pool],
      )
      bi_c = usmp_utils.BufferInfo(
          name_hint="bi_c",
          size_bytes=100,
          pool_candidates=[global_workspace_pool],
      )
      bi_d = usmp_utils.BufferInfo(
          name_hint="bi_d",
          size_bytes=40,
          pool_candidates=[global_workspace_pool],
      )
      bi_e = usmp_utils.BufferInfo(
          name_hint="bi_e",
          size_bytes=50,
          pool_candidates=[global_workspace_pool],
      )
      bi_f = usmp_utils.BufferInfo(
          name_hint="bi_f",
          size_bytes=60,
          pool_candidates=[global_workspace_pool],
      )
      bi_g = usmp_utils.BufferInfo(
          name_hint="bi_g",
          size_bytes=70,
          pool_candidates=[global_workspace_pool],
      )
  
      # Creating conflicts for a linear graph
      bi_a.set_conflicts([bi_b, bi_c])
      bi_b.set_conflicts([bi_a, bi_c, bi_e])
      bi_c.set_conflicts([bi_e, bi_a, bi_b, bi_d])
      bi_d.set_conflicts([bi_b, bi_f, bi_c, bi_e])
      bi_e.set_conflicts([bi_c, bi_f, bi_b, bi_d])
      bi_f.set_conflicts([bi_d, bi_e, bi_f])
      bi_g.set_conflicts([bi_f])
  
      buffer_info_arr = [bi_a, bi_b, bi_c, bi_d, bi_e, bi_f, bi_g]
      fusmp_algo = tvm.get_global_func(f"tir.usmp.algo.{algorithm}")
      buffer_pool_allocations = fusmp_algo(buffer_info_arr, 0)
      _check_max_workspace_size(
          buffer_pool_allocations, global_workspace_pool, workspace_size
      )
  
imports: import pytest
  import tvm
  from tvm import tir, script
  from tvm.script import tir
  from tvm.tir import stmt_functor
  from tvm.tir.usmp import utils
  from tvm.target import Target
  from tvm import WorkspacePoolInfo, PoolInfoProperties
label_desc: Use image node_id 11 for calling a global function with example usage: test_fanout(algorithm, workspace_size) without return types