class_docstr: Shared allocations should be merged, preserving DeclBuffer if present
  
  This test uses a matmul PrimFunc adapted from
  test_matmul_dyn_shared, using either `T.Buffer` (Allocate without
  DeclBuffer) or `T.decl_buffer` (Allocate followed by DeclBuffer)
  for the replaced allocations.
class_docstr_tok: ["Shared","allocations","should","be","merged",",","preserving","DeclBuffer","if","present","This","test","uses","a","matmul","PrimFunc","adapted","from","test_matmul_dyn_shared",",","using","either","`","T.Buffer","`","(","Allocate","without","DeclBuffer",")","or","`","T.decl_buffer","`","(","Allocate","followed","by","DeclBuffer",")","for","the","replaced","allocations","."]
code: def buffer_func(self, use_decl_buffer):
      if use_decl_buffer:
          return T.decl_buffer
      else:
          return T.Buffer
  
imports: import numpy
  import tvm
  import tvm.testing
  from tvm import te
  from tvm.driver.build_module import schedule_to_module
  from tvm.topi.math import cast
  from tvm.script import tir
label_desc: Use image node_id 1 for calling the TestMatmul obj's underlying member method code with example usage: obj.buffer_func(use_decl_buffer) and returns: T, T