module grammar_sklearn.cc.c_compilation
¶
Short summary¶
module mlprodict.grammar_sklearn.cc.c_compilation
Helpers to compile C.
Classes¶
class |
truncated documentation |
---|---|
Raised when a compilation error was detected. |
Functions¶
function |
truncated documentation |
---|---|
Compiles a C function with cffi. It takes one features vector. |
Documentation¶
Helpers to compile C.
- exception mlprodict.grammar_sklearn.cc.c_compilation.CompilationError¶
Bases:
Exception
Raised when a compilation error was detected.
- mlprodict.grammar_sklearn.cc.c_compilation.compile_c_function(code_c, nbout, dtype=<class 'numpy.float32'>, add_header=True, suffix='', additional_paths=None, tmpdir='.', fLOG=None)¶
Compiles a C function with cffi. It takes one features vector.
- Parameters
nbout – number of expected outputs
code_c – code C
dtype – numeric type to use
add_header – add common function before compiling
suffix – avoid avoid the same compiled module name
additional_paths – additional paths to add to the module
tmpdir – see below
fLOG – logging function
- Returns
compiled function
The function assumes the first line is the signature. If you are using Windows with Visual Studio 2017, make sure you are using Python 3.6.3+ (see Issue 30389). Parameter tmpdir is used by function compile.