code: def test_kernel(input_array_gpu):
      mod = SourceModule(
          """
          __global__ void f(float * out, float * in)
          {
              int idx = threadIdx.x;
              out[idx] = in[idx] + 6;
          }
          """
      )
      func = mod.get_function("f")
  
      output_array = numpy.zeros((1, 512))
      output_array_gpu = cuda.mem_alloc(output_array.nbytes)
  
      func(output_array_gpu, input_array_gpu, block=(512, 1, 1))
      cuda.memcpy_dtoh(output_array, output_array_gpu)
  
      return output_array
  
file_path: pycuda/examples/from-wiki/multiple_threads.py
imports: import pycuda
  import pycuda.driver
  from pycuda.compiler import SourceModule
  import threading
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: test_kernel(input_array_gpu) and returns: output_array