code: def downcast_test(
      src_dtype,
      dst_dtype,
      rounding,
      exponent_bits,
      mantissa_bits,
      exponent_bias,
      max_repr,
      offset,
  ):
      src = launch_exhaustive_populate(
          src_dtype,
          offset << 24,
          2**24,
          False,
          src_dtype.primitive_bitwidth,
          max_repr,
      )
      dst = launch_type_convert_triton(
          src, src_dtype, dst_dtype, rounding
      )
      src = launch_type_convert_triton(src, src_dtype, tl.float32)
  
      dst2 = launch_downcast_emulated(
          src,
          tl.float32,
          dst_dtype,
          rounding,
          exponent_bits,
          mantissa_bits,
          exponent_bias,
      )
  
      dst = launch_upcast_emulated(
          dst, exponent_bits, mantissa_bits, exponent_bias
      )
      dst2 = launch_upcast_emulated(
          dst2, exponent_bits, mantissa_bits, exponent_bias
      )
  
      if not (torch.equal(dst, dst2)):
          print("Error!!!")
  
          dst = dst.cpu().detach().numpy()
          dst2 = dst2.cpu().detach().numpy()
          src = src.cpu().detach().numpy()
  
          print(src[dst != dst2][0])
          print(dst[dst != dst2][0])
          print(dst2[dst != dst2][0])
          print(hex(src.view(np.uint32)[dst != dst2][0]))
          print(hex(dst.view(np.uint32)[dst != dst2][0]))
          print(hex(dst2.view(np.uint32)[dst != dst2][0]))
          print("")
          raise ValueError("%d elements mismatch" % (dst != dst2).sum())
  
file_path: triton/python/test/unit/language/test_conversions.py
imports: import numpy
  import torch
  import pytest
  import triton
  import triton.language
label_desc: Use image node_id 11 for calling a global function with example usage: downcast_test(src_dtype, dst_dtype, rounding, exponent_bits, mantissa_bits, exponent_bias, max_repr, offset) without return types