Class JITCompiler

Class Documentation

class JITCompiler

Just-In-Time (JIT) compiler. Compiles and load c++ source files as dynamic libraries. In the CPU implementation, g++ is used. For the GPU implementation, nvcc is used with g++ as host compiler.

Public Functions

JITCompiler(const std::string &dlib_dir)

Constructs a compiler with the given compile directory path.

Parameters

dlib_dir – The path to the directory where dynamic library are compiled.

DynamicLibraryLoader &operator()(const std::string &source_file)

Compiles and load the given source file. If the source file has already been compiled, JITCompiler skips compilation and returns the pre-loaded dynamic library.

Parameters

source_file – Path to the source file to compile.

Returns

The loaded dynamic library.