Header Files and Library Files

This section describes the external APIs provided by the UDF module. You can call these APIs to develop custom processing functions, and then execute such functions on the CPU through DataFlow graph construction.

You can view the header files of the corresponding APIs in ${INSTALL_DIR}/include/flow_func.

Replace ${INSTALL_DIR} with the CANN component directory. For example, if the installation is performed by the root user, the default file storage path is /usr/local/Ascend/cann.

API Categories and Corresponding Header Files

Table 1 API categories and corresponding header files

API Category

Header File Path

Description

Matching Library File

AttrValue class

attr_value.h

Used to obtain the attribute values set by the user.

libflow_func.so

AscendString class

ascend_string.h

Encapsulation for the string type.

libflow_func.so

MetaContext class

meta_context.h

Used to process UDF context, such as allocating tensors and obtaining configured attributes.

libflow_func.so

FlowMsg class

flow_msg.h

Used to process the input and output operations of FlowFunc.

libflow_func.so

Tensor class

flow_msg.h

Used to perform tensor-related operations.

libflow_func.so

MetaFlowFunc class

meta_flow_func.h

Defined in meta_flow_func.h. You can inherit this class to compile custom single-func processing functions.

libflow_func.so

MetaMultiFunc class

meta_multi_func.h

Defined in meta_multi_func.h. You can inherit this class to compile custom multi-func processing functions.

libflow_func.so

FlowFuncRegistrar class

meta_multi_func.h

Defined in meta_multi_func.h. This is an auxiliary template class for registering MetaMultiFunc.

libflow_func.so

MetaParams class

meta_params.h

Defined in meta_params.h and used in the multi-func processing function of FlowFunc to obtain shared variable information.

libflow_func.so

MetaRunContext class

meta_run_context.h

Used to process the context of the multi-func processing function of FlowFunc, such as allocating a tensor, setting the output, and running FlowModel.

libflow_func.so

OutOptions class

out_options.h

Used to carry related options when a service releases data.

libflow_func.so

BalanceConfig class

balance_config.h

When balanced distribution is required, you need to configure the output data identifier and weight matrix. The scheduling module can implement balanced distribution among multiple instances based on the configuration.

libflow_func.so

FlowBufferFactory class

flow_msg.h

-

libflow_func.so

FlowMsgQueue class

flow_msg_queue.h

Used to serve as the input queue of FlowFunc in scenarios with streaming input (the input parameter of FlowFunc is a queue). The data object in the queue is of the FlowMsg class.

libflow_func.so

Registration macros

meta_flow_func.h

meta_multi_func.h

-

libflow_func.so

UDF log APIs

flow_func_log.h

flow_func_log.h provides log APIs to facilitate log recording during FlowFunc development.

libflow_func.so

Error codes

flow_func_defines.h

-

libflow_func.so