code: def get_put_kernel(context, dtype, idx_dtype, vec_count=1):
      idx_tp = dtype_to_ctype(idx_dtype)
  
      args = (
          [
              VectorArg(dtype, f"dest{i}", with_offset=True)
              for i in range(vec_count)
          ]
          + [
              VectorArg(idx_dtype, "gmem_dest_idx", with_offset=True),
          ]
          + [
              VectorArg(dtype, f"src{i}", with_offset=True)
              for i in range(vec_count)
          ]
          + [VectorArg(np.uint8, "use_fill", with_offset=True)]
          + [VectorArg(np.int64, "val_ary_lengths", with_offset=True)]
      )
  
      body = f"{idx_tp} dest_idx = gmem_dest_idx[i];\n" + "\n".join(
          f"dest{i}[dest_idx] = (use_fill[{i}] ? src{i}[0] : "
          f"src{i}[i % val_ary_lengths[{i}]]);"
          for i in range(vec_count)
      )
  
      return get_elwise_kernel(
          context,
          args,
          body,
          preamble=dtype_to_c_struct(context.devices[0], dtype),
          name="put",
      )
  
imports: import enum
  from typing import Any, List, Optional, Tuple, Union
  import numpy
  import pyopencl
  from pyopencl.tools import context_dependent_memoize
  from pyopencl.tools import dtype_to_ctype, DtypedArgument, VectorArg, ScalarArg, KernelTemplateBase, dtype_to_c_struct
  from pytools import memoize_method
label_desc: Use image node_id 8 for calling a global function with example usage: get_put_kernel(context, dtype, idx_dtype, vec_count) and returns: get_elwise_kernel