Mousius opened a new pull request #8452:
URL: https://github.com/apache/tvm/pull/8452
This patch passes the resource_handle variable through the AOT executor
down to the backend operators. In order to model this on the `PrimFunc`
the resource_handle was added as a property, the resource_handle property
is then added to the arguments when transformed via MakeUnpackedAPI.
The flow of the resource_handle looks similar to this:
```c
int32_t __tvm_main__(void* args, void* type_code, int num_args, void*
out_value, void* out_type_code, void* resource_handle) {
return tvmgen_run_model(
((DLTensor*)(((TVMValue*)args)[0].v_handle))[0].data,
((DLTensor*)(((TVMValue*)args)[1].v_handle))[0].data,
((DLTensor*)(((TVMValue*)args)[2].v_handle))[0].data,
((DLTensor*)(((TVMValue*)args)[3].v_handle))[0].data,
resource_handle
);
}
TVM_DLL int32_t tvmgen_run_model(void* arg0, void* arg1, void* arg2, void*
arg3, void* resource_handle) {
void* input = arg0;
void* input1 = arg1;
void* input2 = arg2;
void* output = arg3;
(void)tvmgen_fused_concatenate_add(input, input1, input2, output,
resource_handle);
return 0;
}
```
@areusch @manupa-arm
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]