code: def test_multichannel_2d_texture(self):
      mod = SourceModule(
          """
          #define CHANNELS 4
          texture<float4, 2, cudaReadModeElementType> mtx_tex;
  
          __global__ void copy_texture(float *dest)
          {
            int row = threadIdx.x;
            int col = threadIdx.y;
            int w = blockDim.y;
            float4 texval = tex2D(mtx_tex, row, col);
            dest[(row*w+col)*CHANNELS + 0] = texval.x;
            dest[(row*w+col)*CHANNELS + 1] = texval.y;
            dest[(row*w+col)*CHANNELS + 2] = texval.z;
            dest[(row*w+col)*CHANNELS + 3] = texval.w;
          }
          """
      )
  
      copy_texture = mod.get_function("copy_texture")
      mtx_tex = mod.get_texref("mtx_tex")
  
      shape = (5, 6)
      channels = 4
      a = np.asarray(
          np.random.randn(*((channels,) + shape)),
          dtype=np.float32,
          order="F",
      )
      drv.bind_array_to_texref(
          drv.make_multichannel_2d_array(a, order="F"), mtx_tex
      )
  
      dest = np.zeros(shape + (channels,), dtype=np.float32)
      copy_texture(drv.Out(dest), block=shape + (1,), texrefs=[mtx_tex])
      reshaped_a = a.transpose(1, 2, 0)
      # print reshaped_a
      # print dest
      assert la.norm(dest - reshaped_a) == 0
  
imports: import numpy
  import numpy.linalg
  from pycuda.tools import mark_cuda_test, dtype_to_ctype
  import pytest
  import pycuda.gpuarray
  import pycuda.driver
  from pycuda.compiler import SourceModule
label_desc: Use image node_id 11 for calling the TestDriver obj's underlying member method code with example usage: obj.test_multichannel_2d_texture() without return types