Multi-Func Processing Function
Applicability
Product |
Supported |
|---|---|
√ |
|
√ |
|
x |
|
x |
|
x |
Function Description
Defines the user-defined multi-FlowFunc processing function.
Prototype
- In common scenarios, the function input is prepared by the framework and directly provided to users. Users can directly use FlowMsg within the input parameters.
1std::function<int32_t> (const std::shared_ptr<MetaRunContext> &runContext, const std::vector<std::shared_ptr<FlowMsg>> &flowMsg)
- In scenarios with streaming input (the function's input parameter is a queue), users obtain data from the input queue.
1std::function<int32_t> (const std::shared_ptr<MetaRunContext> &runContext, const std::vector<std::shared_ptr<FlowMsgQueue>> &flowMsgQueue)
Command-Line Options
Parameter |
Input/Output |
Description |
|---|---|---|
runContext |
Input |
Context of the processing function. |
FlowMsg/FlowMsgQueue |
Input |
Input parameters or input queue of the function. |
Returns
- 0: success
- Other values: failure. For details, see UDF Error Codes.
Troubleshooting
- If there is unrecoverable error information, ERROR is returned.
- In other cases, call SetRetcode to set the error code of the output tensor.
- If success is returned, the scheduling is terminated.
Constraints
When using the streaming input FlowFunc, set stream_input of the corresponding func to true in the ProcessPoint compilation configuration file. The sample code is as follows:
{
"func_list": [
{
"func_name": "Func",
"stream_input": true
}
],
"input_num": 1,
"output_num": 1,
"target_bin": "libfunc.so",
"workspace": "./",
"cmakelist_path": "CMakeLists.txt",
}
Parent topic: ResetFlowFuncState