custom_op_run
Function
Entry function for the commissioning of a single custom operator. This function is defined in custom\custom_op.h.
The return value of custom_op_run is of the ErrorInfo type, including the error code and error description. If the error code is 0, the operation is successful. Other values indicate failure. The ErrorInfo type is defined as follows:
struct ErrorInfo { uint32_t error_code; std::string error_msg; };
Syntax
ErrorInfo custom_op_run(const std::string& name, int32_t type, const std::string& bin_file,
const std::vector< std::string >& in_files,
const std::vector< std::string >& out_files,
const std::vector< uint32_t >& out_buf_sizes,
const std::vector< uint32_t >& workspace_sizes = std::vector<uint32_t>(),
const std::string& op_cfg_file = "", void *param = nullptr, int param_len = 0);
Parameter Description
Parameter |
Input/Output |
Description |
---|---|---|
name |
Input |
Operator kernel name |
type |
Input |
Operator type:
|
bin_file |
Input |
Binary file path of an operator, including the file name. A relative path is supported. In this case, the binary file must be stored in the directory where the program is located, for example ./*.bin. |
in_files |
Input |
Path of the input data file, including the file name. A relative path is supported. In this case, the data file must be stored in the directory where the program is located. |
out_files |
Input |
Path of the output data file, including the file name. A relative path is supported. In this case, the data file must be stored in the directory where the program is located. |
out_buf_sizes |
Input |
Size of the output data, in bytes |
workspace_sizes |
Input |
Size of the workspace, in bytes |
op_cfg_file |
Input |
Input and output description of the operator specified by the user |
param |
Input |
Address information of the parameter structure of the operator specified by the user |
param_len |
Input |
Length of the parameter structure of the operator specified by the user, in bytes. The structure length can be obtained using sizeof(param). |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot