Multi-Func Processing Function

Applicability

Product

Supported

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

x

Atlas inference products

x

Atlas training products

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.
    1
    std::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.
    1
    std::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

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",
}