NVIDIA DeepStream SDK API Reference

6.4 Release
infer_trtis_utils.h File Reference

Detailed Description

Triton Inference Server utilies header file.

Definition in file infer_trtis_utils.h.

Go to the source code of this file.

Namespaces

 nvdsinferserver
 Copyright (c) 2021, NVIDIA CORPORATION.
 

Macros

#define CHECK_TRTIS_ERR_W_ACTION(trtisExpr, action, fmt, ...)
 Checks the TRITONSERVER_Error object returned by the trtisExpr. More...
 
#define RETURN_TRTIS_ERROR(trtisExpr, fmt, ...)   CHECK_TRTIS_ERR_W_ACTION(trtisExpr, return NVDSINFER_TRITON_ERROR, fmt, ##__VA_ARGS__)
 Checks the TRITONSERVER_Error object returned by the trtisExpr. More...
 
#define CONTINUE_TRTIS_ERROR(trtisExpr, fmt, ...)   CHECK_TRTIS_ERR_W_ACTION(trtisExpr, , fmt, ##__VA_ARGS__)
 Check the TRITONSERVER_Error object returned by the trtisExpr. More...
 

Functions

InferDataType nvdsinferserver::DataTypeFromTriton (TRITONSERVER_DataType type)
 Maps the TRITONSERVER_DataType to the InferDataType. More...
 
TRITONSERVER_DataType nvdsinferserver::DataTypeToTriton (InferDataType type)
 Maps the InferDataType to TRITONSERVER_DataType. More...
 
InferDataType nvdsinferserver::DataTypeFromTritonPb (ni::DataType type)
 Maps the data type from Triton model configuration proto definition to InferDataType. More...
 
InferTensorOrder nvdsinferserver::TensorOrderFromTritonPb (ni::ModelInput::Format order)
 Maps the tensor order from Triton model configuration proto definition to the InferTensorOrder type. More...
 
InferTensorOrder nvdsinferserver::TensorOrderFromTritonMeta (const std::string &format)
 Maps the tensor order from Triton metadata string to the InferTensorOrder type. More...
 
TRITONSERVER_MemoryType nvdsinferserver::MemTypeToTriton (InferMemType type)
 Maps the InferMemType to the TRITONSERVER_MemoryType. More...
 
InferMemType nvdsinferserver::MemTypeFromTriton (TRITONSERVER_MemoryType type)
 Maps the TRITONSERVER_MemoryType to the InferMemType. More...
 
template<typename VecDims >
InferDims nvdsinferserver::DimsFromTriton (const VecDims &shape)
 Converts the input shape vector from Triton to InferDims type. More...
 
const char * nvdsinferserver::TritonControlModeToStr (int32_t mode)
 Returns a string describing the TRITONSERVER_ModelControlMode: none, explicit or poll. More...
 

Macro Definition Documentation

◆ CHECK_TRTIS_ERR_W_ACTION

#define CHECK_TRTIS_ERR_W_ACTION (   trtisExpr,
  action,
  fmt,
  ... 
)
Value:
do { \
UniqTritonT<TRITONSERVER_Error> errPtr( \
(trtisExpr), TRITONSERVER_ErrorDelete); \
if (errPtr) { \
InferError( \
"Triton: " fmt ", triton_err_str:%s, err_msg:%s", \
##__VA_ARGS__, TRITONSERVER_ErrorCodeString(errPtr.get()), \
TRITONSERVER_ErrorMessage(errPtr.get())); \
action; \
} \
} while (0)

Checks the TRITONSERVER_Error object returned by the trtisExpr.

In case of error, performs the specified action after logging the error message.

Definition at line 40 of file infer_trtis_utils.h.

◆ CONTINUE_TRTIS_ERROR

#define CONTINUE_TRTIS_ERROR (   trtisExpr,
  fmt,
  ... 
)    CHECK_TRTIS_ERR_W_ACTION(trtisExpr, , fmt, ##__VA_ARGS__)

Check the TRITONSERVER_Error object returned by the trtisExpr.

In case of error, log the error and continue.

Definition at line 64 of file infer_trtis_utils.h.

◆ RETURN_TRTIS_ERROR

#define RETURN_TRTIS_ERROR (   trtisExpr,
  fmt,
  ... 
)    CHECK_TRTIS_ERR_W_ACTION(trtisExpr, return NVDSINFER_TRITON_ERROR, fmt, ##__VA_ARGS__)

Checks the TRITONSERVER_Error object returned by the trtisExpr.

In case of error, logs the error and returns with NVDSINFER_TRITON_ERROR.

Definition at line 57 of file infer_trtis_utils.h.

TRITONSERVER_ErrorDelete
TRITONSERVER_DECLSPEC void TRITONSERVER_ErrorDelete(TRITONSERVER_Error *error)
Delete an error object.
TRITONSERVER_ErrorMessage
const TRITONSERVER_DECLSPEC char * TRITONSERVER_ErrorMessage(TRITONSERVER_Error *error)
Get the error message.
TRITONSERVER_ErrorCodeString
const TRITONSERVER_DECLSPEC char * TRITONSERVER_ErrorCodeString(TRITONSERVER_Error *error)
Get the string representation of an error code.