code: def transpose_using_cl(ctx, queue, cpu_src, cls):
      mf = cl.mem_flags
      a_buf = cl.Buffer(
          ctx, mf.READ_ONLY | mf.COPY_HOST_PTR, hostbuf=cpu_src
      )
      a_t_buf = cl.Buffer(ctx, mf.WRITE_ONLY, size=cpu_src.nbytes)
      cls(ctx)(queue, a_t_buf, a_buf, cpu_src.shape)
  
      w, h = cpu_src.shape
      result = numpy.empty((h, w), dtype=cpu_src.dtype)
      cl.enqueue_copy(queue, result, a_t_buf).wait()
  
      a_buf.release()
      a_t_buf.release()
  
      return result
  
file_path: pyopencl/examples/transpose.py
imports: import pyopencl
  import numpy
  import numpy.linalg
label_desc: Use image node_id 1 for calling a global function with example usage: transpose_using_cl(ctx, queue, cpu_src, cls) and returns: result