/**
* @brief remove all registered models
- * @return 0
+ * @return 0 if device can unset model. otherwise return 1
*/
int
HostHandler::unregisterModels () {
/**
* @brief Set the request's constraint
- * @param[in] dev The NPU device handle
* @param[in] req_id The request ID
* @param[in] constraint inference constraint (e.g., timeout, priority)
* @return 0 if no error. Otherwise a negative errno
/**
* @brief Get tensor size that the target model assumes
- * @param[in] model_id The target model id
+ * @param[in] model the model instance
* @param[in] input true if it's input tensor
* @param[in] index tensor index
* @param[out] size tensor size
return 0;
}
-/** @brief implementation of TRIV2's run() */
+/**
+ * @brief implementation of TRIV2's run()
+ * @param[in] opmode the opmode of the request
+ * @param[in] model the model instance
+ * @param[in] input the input data buffers
+ * @param[in] output the output data buffers
+ * @param[in] cb the output callback handler
+ * @param[out] cb_data the inferecne data of the request
+ */
int
TrinityVision2::run (npu_input_opmode opmode, const Model *model, const input_buffers *input,
output_buffers *output, npuOutputNotify cb, void *cb_data) {
cb (output, req->getID (), cb_data);
}
+/**
+ * @brief Create NPU inferance request
+ * @param[in] model the model instance
+ * @param[out] req_id the request id
+ * @return 0 if no error, otherwise a negative errno
+ */
int
TrinityVision2::createRequest (const Model *model, int *req_id) {
Request *req;
return 0;
}
+/**
+ * @brief Remove the request instance
+ * @param[in] req_id The request's ID
+ * @return 0 if no error. Otherwise a negative errno
+ */
int
TrinityVision2::removeRequest (int req_id) {
Request *req = scheduler_->findRequest (req_id);
return 0;
}
+/**
+ * @brief Get the request's model id
+ * @param[in] req_id The request's ID
+ * @param[out] model_id The request's model ID
+ * @return 0 if no error. Otherwise a negative errno
+ */
int
TrinityVision2::getRequestModel (int req_id, uint32_t *model_id) {
if (model_id == nullptr) {
return 0;
}
+/**
+ * @brief Set request's input/output data
+ * @param[in] req_id The request ID
+ * @param[in] input The input data buffers
+ * @param[in] in_info The input data info (format, type)
+ * @param[in] output The output data buffers
+ * @param[in] out_info The output data info (format, type)
+ * @return 0 if no error. Otherwise a negative errno
+ */
int
TrinityVision2::setRequestData (int req_id, input_buffers *input, tensors_data_info *in_info,
output_buffers *output, tensors_data_info *out_info) {
return 0;
}
+/**
+ * @brief Set output callback of the request
+ * @param[in] req_id The request ID
+ * @param[in] cb The output callback handler
+ * @param[in] [nullable] data The data to pass to callback handler
+ * @return 0 if no error. Otherwise a negative errno
+ */
int
TrinityVision2::setRequestCallback (int req_id, npuOutputNotify cb, void *data) {
Request *req = scheduler_->findRequest (req_id);
return 0;
}
+/**
+ * @brief Set the request's inference mode
+ * @param[in] req_id The request ID
+ * @param[in] mode Configures how this inference works.
+ * @return 0 if no error. Otherwise a negative errno
+ */
int
TrinityVision2::setRequestMode (int req_id, npu_infer_mode mode) {
Request *req = scheduler_->findRequest (req_id);
return 0;
}
+/**
+ * @brief Set the request's constraint
+ * @param[in] req_id The request ID
+ * @param[in] constraint inference constraint (e.g., timeout, priority)
+ * @return 0 if no error. Otherwise a negative errno
+ */
int
TrinityVision2::setRequestConstraint (int req_id, npu_constraint constraint) {
Request *req = scheduler_->findRequest (req_id);
return 0;
}
+/**
+ * @brief Set the request's scheduler
+ * @param[in] req_id The request ID
+ * @param[in] sched npu scheduler
+ * @param[in] sched_param npu scheduler param
+ * @return 0 if no error. Otherwise a negative errno
+ */
int
TrinityVision2::setRequestScheduler (int req_id, npu_scheduler sched,
npu_scheduler_param sched_param) {
return 0;
}
+/**
+ * @brief Submit the request to the NPU
+ * @param[in] req_id The request ID
+ * @return 0 if no error. Otherwise a negative errno
+ */
int
TrinityVision2::submitRequest (int req_id) {
Request *req = scheduler_->findRequest (req_id);
return status;
}
+/**
+ * @brief Submit the request to the NPU working with kernel modules
+ * @param[in] req_id The request ID
+ * @return 0 if no error. Otherwise a negative errno
+ */
int
TrinityVision2::submitRequestKernel (int req_id) {
Request *req = scheduler_->findRequest (req_id);