code: def _get_generic_filter_raw(
      rk, filter_size, mode, wshape, offsets, cval, int_type
  ):
      """Generic filter implementation based on a raw kernel."""
      setup = """
      int iv = 0;
      double values[{}];
      double val_out;""".format(
          filter_size
      )
  
      sub_call = """raw_kernel::{}(values, {}, &val_out);
      y = cast<Y>(val_out);""".format(
          rk.name, filter_size
      )
  
      return _filters_core._generate_nd_kernel(
          "generic_{}_{}".format(filter_size, rk.name),
          setup,
          "values[iv++] = cast<double>({value});",
          sub_call,
          mode,
          wshape,
          int_type,
          offsets,
          cval,
          preamble="namespace raw_kernel {{\n{}\n}}".format(
              # Users can test RawKernel independently, but when passed to here
              # it must be used as a device function here. In fact, RawKernel
              # wouldn't compile if code only contains device functions, so this
              # is necessary.
              rk.code.replace("__global__", "__device__")
          ),
          options=rk.options,
      )
  
file_path: cupy/cupyx/scipy/ndimage/_filters_generic.py
imports: import cupy
  from cupy_backends.cuda.api import runtime
  from cupy import _util
  from cupyx.scipy.ndimage import _filters_core
label_desc: Use image node_id 5 for calling a global function with example usage: _get_generic_filter_raw(rk, filter_size, mode, wshape, offsets, cval, int_type) and returns: _filters_core