code: def _cuda_mapper(mapper):
      @cuda.jit
      def kernel(in_array, out_array):
          i, j = cuda.grid(2)
          if i < out_array.shape[0] and j < out_array.shape[1]:
              out_array[i, j] = mapper(in_array[i, j])
  
      def cuda_map(in_array):
          out_array = cupy.zeros(in_array.shape, dtype="float64")
          in_array = cuda.to_device(in_array)
          kernel[cuda_args(in_array.shape)](in_array, out_array)
          return out_array
  
      return cuda_map
  
imports: import math
  from toolz import memoize
  import numpy
  from datashader.glyphs.glyph import Glyph
  from datashader.resampling import infer_interval_breaks
  from datashader.utils import isreal, ngjit, ngjit_parallel
  import numba
  from numba import cuda, prange
label_desc: Use image node_id 1 for calling a global function with example usage: _cuda_mapper(mapper) and returns: cuda_map, out_array