Treelite
Classes | Typedefs | Functions
c_api_common.cc File Reference

C API of treelite (this file is used by both runtime and main package) More...

#include <treelite/thread_local.h>
#include <treelite/logging.h>
#include <treelite/data.h>
#include <treelite/c_api_common.h>
#include <treelite/c_api_error.h>
Include dependency graph for c_api_common.cc:

Go to the source code of this file.

Classes

struct  TreeliteAPIThreadLocalEntry
 entry to to easily hold returning information More...
 

Typedefs

using TreeliteAPIThreadLocalStore = ThreadLocalStore< TreeliteAPIThreadLocalEntry >
 

Functions

int TreeliteRegisterLogCallback (void(*callback)(const char *))
 register callback function for LOG(INFO) messages – helpful messages that are not errors. Note: this function can be called by multiple threads. The callback function will run on the thread that registered it More...
 
int TreeliteDMatrixCreateFromCSR (const void *data, const char *data_type_str, const uint32_t *col_ind, const size_t *row_ptr, size_t num_row, size_t num_col, DMatrixHandle *out)
 create DMatrix from a (in-memory) CSR matrix More...
 
int TreeliteDMatrixCreateFromMat (const void *data, const char *data_type_str, size_t num_row, size_t num_col, const void *missing_value, DMatrixHandle *out)
 create DMatrix from a (in-memory) dense matrix More...
 
int TreeliteDMatrixGetDimension (DMatrixHandle handle, size_t *out_num_row, size_t *out_num_col, size_t *out_nelem)
 get dimensions of a DMatrix More...
 
int TreeliteDMatrixFree (DMatrixHandle handle)
 delete DMatrix from memory More...
 

Detailed Description

C API of treelite (this file is used by both runtime and main package)

Copyright (c) 2017-2021 by Contributors

Author
Hyunsu Cho

Definition in file c_api_common.cc.

Function Documentation

◆ TreeliteRegisterLogCallback()

int TreeliteRegisterLogCallback ( void(*)(const char *)  callback)

register callback function for LOG(INFO) messages – helpful messages that are not errors. Note: this function can be called by multiple threads. The callback function will run on the thread that registered it

Returns
0 for success, -1 for failure

Definition at line 25 of file c_api_common.cc.