You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/01/21 04:50:18 UTC

[GitHub] [tvm] A1245967 opened a new issue #10012: [Bug] limited function numbers on crt runtime

A1245967 opened a new issue #10012:
URL: https://github.com/apache/tvm/issues/10012


   I found the variable `num_funcs` is stored at a _char_ but `tvm_function_index_t` uses _uint16_t_ in the function [TVMFuncRegistry_GetByIndex](https://github.com/apache/tvm/blob/main/src/runtime/crt/common/func_registry.c#L82).
   It will have an error `invalid function index` when the number of functions is more than 256.
   
   ``` c
   tvm_crt_error_t TVMFuncRegistry_GetByIndex(const TVMFuncRegistry* reg,
                                              tvm_function_index_t function_index,
                                              TVMBackendPackedCFunc* out_func) {
     uint8_t num_funcs;
   
     num_funcs = reg->names[0];
     if (function_index >= num_funcs) {
       return kTvmErrorFunctionIndexInvalid;
     }
   
     *out_func = reg->funcs[function_index];
     return kTvmErrorNoError;
   }
   ```


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org