code: def _gtsv2_hlo(
      platform,
      gpu_sparse,
      dl,
      d,
      du,
      B,
      *,
      m,
      n,
      ldb,
      t,
      b_shape_vals=None,
  ):
      """Calls `cusparse<t>gtsv2(dl, d, du, B, m, n, ldb)`."""
      assert len(b_shape_vals) >= 2
      batch_dim_vals = b_shape_vals[:-2]
      batch_size = math.prod(batch_dim_vals)
      num_bd = len(b_shape_vals) - 2
      f32 = t == np.float32
      if f32:
          buffer_size = gpu_sparse.gtsv2_f32_buffer_size(m, n, ldb)
      else:
          buffer_size = gpu_sparse.gtsv2_f64_buffer_size(m, n, ldb)
  
      b_layout = (num_bd, num_bd + 1) + tuple(range(num_bd - 1, -1, -1))
      d_layout = (num_bd,) + tuple(range(num_bd - 1, -1, -1))
      b_type = ir.RankedTensorType(B.type)
  
      shape_type_pairs = [
          (batch_dim_vals + (ldb, n), b_type.element_type),
          ((buffer_size,), ir.IntegerType.get_signless(8)),
      ]
      result_types, result_shapes = mk_result_types_and_shapes(
          shape_type_pairs
      )
      out = custom_call(
          f"{platform}sparse_gtsv2_" + ("f32" if f32 else "f64"),
          result_types=result_types,
          operands=[dl, d, du, B],
          backend_config=gpu_sparse.build_gtsv2_descriptor(
              batch_size, m, n, ldb
          ),
          operand_layouts=[d_layout] * 3 + [b_layout],
          result_layouts=[b_layout, [0]],
          operand_output_aliases={3: 0},
          result_shapes=result_shapes,
      ).results
      return out[0]
  
file_path: jax/jaxlib/gpu_sparse.py
imports: import math
  from functools import partial
  import importlib
  import jaxlib.mlir.ir
  import numpy
  from jaxlib import xla_client
  from .hlo_helpers import custom_call, mk_result_types_and_shapes
label_desc: Use image node_id 11 for calling a global function with example usage: _gtsv2_hlo(platform, gpu_sparse, dl, d, du, B) and returns: out