Function CustomExecute

Function Documentation

int CustomExecute(void *custom_context, uint32_t payload_cnt, CustomPayload *payloads, CustomGetNextInputFn_t input_fn, CustomGetOutputFn_t output_fn)

Execute the custom model using the version 1 implementation of the execute interface.

This function must be defined when the custom backend returns 1 from CustomVersion (or when CustomVersion is not defined)

Return

An error code. Zero indicates success, all other values indicate failure. Use CustomErrorString to get the error string for an error code.

Parameters
  • custom_context: The custom state associated with the context that should execute. Can be nullptr if no custom state.

  • payload_cnt: The number of payloads to execute.

  • payloads: The payloads to execute.

  • input_fn: The callback function to get tensor input (see CustomGetNextInputFn_t).

  • output_fn: The callback function to get buffer for tensor output (see CustomGetOutputFn_t).