code: def test_opencl_type_casting():
      def check_type_casting(ctx, n, dtype):
          block_size = 4
          C = te.compute(
              (n,),
              lambda i: tvm.tir.Select(
                  tvm.tir.all(
                      *[
                          i // block_size == tvm.tir.const(3, "int32"),
                          i % 3 == tvm.tir.const(1, "int32"),
                      ]
                  ),
                  tvm.tir.const(1, dtype),
                  tvm.tir.const(0, dtype),
              ),
              name="C",
          )
          # NOTE: test simple convert pattern
          func = te.create_prim_func([C])
          sch = tvm.tir.Schedule(func)
          (x,) = sch.get_loops(sch.get_block("C"))
          tx, vx = sch.split(x, factors=[None, block_size])
          sch.bind(tx, "threadIdx.x")
          sch.vectorize(vx)
  
          fun = tvm.build(sch.mod, target=target)
          c = tvm.nd.empty((n,), dtype, ctx)
          assembly = fun.imported_modules[0].get_source()
          lcond = "convert_int4(((convert_uint4(((uint4)(((convert_int(get_local_id(0))) == 3), ((convert_int(get_local_id(0))) == 3), ((convert_int(get_local_id(0))) == 3), ((convert_int(get_local_id(0))) == 3)))))"
          rcond = "(convert_uint4(((((int4)(((convert_int(get_local_id(0))))+(1*0), ((convert_int(get_local_id(0))))+(1*1), ((convert_int(get_local_id(0))))+(1*2), ((convert_int(get_local_id(0))))+(1*3))) % ((int4)(3, 3, 3, 3))) == ((int4)(1, 1, 1, 1))))))))"
          pattern_cond = "({} && {})".format(lcond, rcond)
          assert assembly.count(pattern_cond) != 0
          fun(c)
  
      dev = tvm.device(target, 0)
  
      check_type_casting(dev, 32, "float32")
  
file_path: tvm/tests/python/codegen/test_target_codegen_opencl.py
imports: import tvm
  from tvm import te, relay
  import tvm.testing
  import re
  import pytest
  import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: test_opencl_type_casting() without return types