code: def matmul(a, b):
      # Check constraints.
      assert a.shape[1] == b.shape[0], "Incompatible dimensions"
      assert a.is_contiguous(), "Matrix A must be contiguous"
      assert b.is_contiguous(), "Matrix B must be contiguous"
      M, K = a.shape
      K, N = b.shape
      # Allocates output.
      c = torch.empty((M, N), device=a.device, dtype=a.dtype)
      # 1D launch kernel where each block gets its own program.
      grid = lambda META: (
          triton.cdiv(M, META["BLOCK_SIZE_M"])
          * triton.cdiv(N, META["BLOCK_SIZE_N"]),
      )
      matmul_kernel_with_block_pointers[grid](
          a,
          b,
          c,  #
          M,
          N,
          K,  #
          a.stride(0),
          a.stride(1),  #
          b.stride(0),
          b.stride(1),  #
          c.stride(0),
          c.stride(1),
      )
      return c
  
imports: import torch
  import triton
  import triton.language
label_desc: Use image node_id 2 for calling a global function with example usage: matmul(a, b) and returns: c