parameters: (name, fn, args)
return_statement: return kernel
docstring: Wrap the query expression in a cuda kernel.
docstring_summary: Wrap the query expression in a cuda kernel.
docstring_tokens: Wrap the query expression in a cuda kernel .
function: def _wrap_query_expr(name, fn, args):
      """Wrap the query expression in a cuda kernel."""
  
      def _add_idx(arg):
          if arg.startswith(ENVREF_PREFIX):
              return arg
          else:
              return f"{arg}[idx]"
  
      def _add_prefix(arg):
          return f"_args_{arg}"
  
      glbls = {"queryfn": fn, "cuda": cuda}
      kernargs = map(_add_prefix, args)
      indiced_args = map(_add_prefix, map(_add_idx, args))
      src = _kernel_source.format(
          kernelname=name,
          args=", ".join(kernargs),
          indiced_args=", ".join(indiced_args),
      )
      exec(src, glbls)
      kernel = glbls[name]
      return kernel
function_tokens: def _wrap_query_expr ( name , fn , args ) : def _add_idx ( arg ) : if arg . startswith ( ENVREF_PREFIX ) : return arg else : return f"{arg}[idx]" def _add_prefix ( arg ) : return f"_args_{arg}" glbls = { "queryfn" : fn , "cuda" : cuda } kernargs = map ( _add_prefix , args ) indiced_args = map ( _add_prefix , map ( _add_idx , args ) ) src = _kernel_source . format ( kernelname = name , args = ", " . join ( kernargs ) , indiced_args = ", " . join ( indiced_args ) , ) exec ( src , glbls ) kernel = glbls [ name ] return kernel