Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix executor for different compilers (apache#8006)
* Fix executor for different compilers At the moment compiling this file throws multiple errors with C++ compilers, this change proposes to fix them. 1. `tvm_model_t->run_func` of type `TVMBackedPackedFunc` returns an int at the moment which is different from the signature of this function `tvm_runtime_run`, implicit casting is not favorable in many compile chains and throws errors. 2. The index of iterators were of type `int` while that of `model->num_input_tensors` and `model->num_output_tensors` were of type `uint32_t`, this type difference again throws errors in many toolchains, and can potentially cause incorrect calculations. 3. C Style struct initialization of tensors with `(DLTensor){...}` is not supported in many C++ toolchains and throws “non-trivial designated initializers not supported” error. Explicitly setting values should work in all cases even though it looks a little less nice. * changing type to size_t * fix format for clang
- Loading branch information