build_pragma_kernel

KernelBuilder kernel_launcher::build_pragma_kernel(const std::string &kernel_name, const KernelSource &source, const std::vector<Value> &template_args = {}, const FileLoader &fs = DefaultLoader{})

Parses the given KernelSource, searches the source code for the kernel with the given kernel_name, extract the KernelLauncher-specific pragmas for that kernel, and returns KernelBuilder.

Parameters:
  • kernel_name – The name of the kernel in the source code. It may contain namespaces such as mypackage::kernels::vector_add.

  • source – The source code. Can be either a filename (like "kernel.cu") or a filename+content pair (like {"kernel.cu", "#include <stdin.h>..."}).

  • template_args – Optional; template arguments passed to the kernel.