NebulaStream  0.6.213
NebulaStream is a data and application management framework for the internet of things
jitify::experimental::Program Class Reference

#include <jitify.hpp>

Public Member Functions

 Program (std::string const &cuda_source, std::vector< std::string > const &given_headers={}, std::vector< std::string > const &given_options={}, file_callback_type file_callback=nullptr)
 
std::string serialize () const
 
Kernel kernel (std::string const &name, std::vector< std::string > const &options={}) const
 

Static Public Member Functions

static Program deserialize (std::string const &serialized_program)
 

Friends

class KernelInstantiation
 

Detailed Description

An object representing a program made up of source code, headers and options.

Constructor & Destructor Documentation

◆ Program()

jitify::experimental::Program::Program ( std::string const &  cuda_source,
std::vector< std::string > const &  given_headers = {},
std::vector< std::string > const &  given_options = {},
file_callback_type  file_callback = nullptr 
)
inline

Create a program.

Parameters
sourceA string containing either the source filename or the source itself; in the latter case, the first line must be the name of the program.
headersA vector of strings representing the source of each header file required by the program. Each entry can be either the header filename or the header source itself; in the latter case, the first line must be the name of the header (i.e., the name by which the header is #included).
optionsA vector of options to be passed to the NVRTC compiler. Include paths specified with -I are added to the search paths used by Jitify. The environment variable JITIFY_OPTIONS can also be used to define additional options.
file_callbackA pointer to a callback function that is invoked whenever a source file needs to be loaded. Inside this function, the user can either load/specify the source themselves or defer to Jitify's file-loading mechanisms.
Note
Program or header source files referenced by filename are looked-up using the following mechanisms (in this order):
1) By calling file_callback.
2) By looking for the file embedded in the executable via the GCC linker.
3) By looking for the file in the filesystem.
Jitify recursively scans all source files for #include directives and automatically adds them to the set of headers needed by the program. If a #include directive references a header that cannot be found, the directive is automatically removed from the source code to prevent immediate compilation failure. This may result in compilation errors if the header was required by the program.
Jitify automatically includes NVRTC-safe versions of some standard library headers.

Member Function Documentation

◆ deserialize()

static Program jitify::experimental::Program::deserialize ( std::string const &  serialized_program)
inlinestatic

Restore a serialized program.

Parameters
serialized_programThe serialized program to restore.
See also
serialize

References jitify::experimental::serialization::deserialize().

Here is the call graph for this function:

◆ kernel()

Kernel jitify::experimental::Program::kernel ( std::string const &  name,
std::vector< std::string > const &  options = {} 
) const
inline

Select a kernel.

Parameters
nameThe name of the kernel (unmangled and without template arguments).
optionsA vector of options to be passed to the NVRTC compiler when compiling this kernel.

◆ serialize()

std::string jitify::experimental::Program::serialize ( ) const
inline

Save the program.

See also
deserialize

References jitify::experimental::serialization::serialize().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ KernelInstantiation

friend class KernelInstantiation
friend

The documentation for this class was generated from the following file: