constant.h 1.5 KB
Newer Older
W
wangguibao 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
#ifndef BAIDU_PADDLE_SERVING_PREDICTOR_CONSTANT_H
#define BAIDU_PADDLE_SERVING_PREDICTOR_CONSTANT_H

#include "common/inner_common.h"

namespace baidu {
namespace paddle_serving {
namespace predictor {

// GFLAGS Variables
DECLARE_bool(use_parallel_infer_service);
DECLARE_int32(el_log_level);
DECLARE_int32(idle_timeout_s);
DECLARE_int32(port);
DECLARE_string(workflow_path);
DECLARE_string(workflow_file);
DECLARE_string(inferservice_path);
DECLARE_string(inferservice_file);
DECLARE_string(logger_path);
DECLARE_string(logger_file);
DECLARE_string(resource_path);
DECLARE_string(resource_file);
DECLARE_bool(enable_mc_cache);
DECLARE_bool(enable_nshead_protocol);
DECLARE_string(nshead_protocol);
DECLARE_int32(max_concurrency);
DECLARE_int32(num_threads);
DECLARE_int32(reload_interval_s);
DECLARE_bool(enable_model_toolkit);
DECLARE_string(enable_protocol_list);

// STATIC Variables
static const char* START_OP_NAME = "startup_op";

// ERRORCODE
enum {
    // internal error
    ERR_INTERNAL_FAILURE = -5000,
    ERR_MEM_ALLOC_FAILURE = -5001,
    ERR_OVERFLOW_FAILURE = -5002,
    // op error
    ERR_OP_INFER_FAILURE = -5100,
    // no error
    ERR_OK = 0,
    // internal ignore
    ERR_IGNORE_FAILURE = 5000,
    // op ignore
    ERR_OP_IGNORE_FAILURE = 5100,
};

static const size_t MAX_WORKFLOW_NUM_IN_ONE_SERVICE = 20; 
static const uint32_t DEFAULT_CACHE_CAPACITY = 10000;
static const uint32_t DEFAULT_CACHE_UNITSIZE = 8192;

} // predictor
} // paddle_serving
} // baidu

#endif