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 2021/01/25 18:59:25 UTC

[GitHub] [tvm] areusch opened a new pull request #7338: Add resource_handle to TVM_DLL_EXPORT_TYPED_FUNC.

areusch opened a new pull request #7338:
URL: https://github.com/apache/tvm/pull/7338


    * In #5921, resource_handle was added as a parameter to
      TVMBackendPackedCFunc, which is the typedef for functions called by
      LibraryModule's function lookup.
    * It appears TVM_DLL_EXPORT_TYPED_FUNC was overlooked in that PR,
      although there don't seem to be any runtime affects known so
      far. However, making this definition proper to avoid any compiler
      warnings/debug tool problems.
    * See also https://discuss.tvm.apache.org/t/rfc-misra-c-changes-for-rpc-support/7098/5


----------------------------------------------------------------
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.

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



[GitHub] [tvm] jinchenglee edited a comment on pull request #7338: Add resource_handle to TVM_DLL_EXPORT_TYPED_FUNC.

Posted by GitBox <gi...@apache.org>.
jinchenglee edited a comment on pull request #7338:
URL: https://github.com/apache/tvm/pull/7338#issuecomment-767695790


   @areusch , there's another macro in packed_func.h needs same fix. You are actually fixing TVM_DLL_EXPORT_PACKED_FUNC in the commit. 
   
   ```
   #define TVM_DLL_EXPORT_TYPED_FUNC(ExportName, Function)                                     \
     extern "C" {                                                                              \
     TVM_DLL int ExportName(TVMValue* args, int* type_code, int num_args, TVMValue* out_value, \
                            int* out_type_code) {                                              \
       try {                                                                                   \
         auto f = Function;                                                                    \
         using FType = ::tvm::runtime::detail::function_signature<decltype(f)>::FType;         \
         ::tvm::runtime::TVMRetValue rv;                                                       \
         ::tvm::runtime::detail::unpack_call_by_signature<FType>::run(                         \
             f, ::tvm::runtime::TVMArgs(args, type_code, num_args), &rv);                      \
         rv.MoveToCHost(out_value, out_type_code);                                             \
         return 0;                                                                             \
       } catch (const ::std::runtime_error& _except_) {                                        \
         TVMAPISetLastError(_except_.what());                                                  \
         return -1;                                                                            \
       }                                                                                       \
     }                                                                                         \
     }
   ```


----------------------------------------------------------------
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.

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



[GitHub] [tvm] areusch commented on pull request #7338: Add resource_handle to TVM_DLL_EXPORT_TYPED_FUNC.

Posted by GitBox <gi...@apache.org>.
areusch commented on pull request #7338:
URL: https://github.com/apache/tvm/pull/7338#issuecomment-767697337


   @jinchenglee gotcha, do you want to submit a PR?


----------------------------------------------------------------
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.

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



[GitHub] [tvm] tqchen commented on pull request #7338: Add resource_handle to TVM_DLL_EXPORT_TYPED_FUNC.

Posted by GitBox <gi...@apache.org>.
tqchen commented on pull request #7338:
URL: https://github.com/apache/tvm/pull/7338#issuecomment-767588682


   Thanks @jinchenglee @areusch !


----------------------------------------------------------------
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.

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



[GitHub] [tvm] areusch commented on pull request #7338: Add resource_handle to TVM_DLL_EXPORT_TYPED_FUNC.

Posted by GitBox <gi...@apache.org>.
areusch commented on pull request #7338:
URL: https://github.com/apache/tvm/pull/7338#issuecomment-767040951


   @jinchenglee @tqchen 


----------------------------------------------------------------
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.

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



[GitHub] [tvm] jinchenglee commented on pull request #7338: Add resource_handle to TVM_DLL_EXPORT_TYPED_FUNC.

Posted by GitBox <gi...@apache.org>.
jinchenglee commented on pull request #7338:
URL: https://github.com/apache/tvm/pull/7338#issuecomment-767875785


   @areusch , created PR #7343 .


----------------------------------------------------------------
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.

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



[GitHub] [tvm] tqchen merged pull request #7338: Add resource_handle to TVM_DLL_EXPORT_TYPED_FUNC.

Posted by GitBox <gi...@apache.org>.
tqchen merged pull request #7338:
URL: https://github.com/apache/tvm/pull/7338


   


----------------------------------------------------------------
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.

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



[GitHub] [tvm] areusch commented on pull request #7338: Add resource_handle to TVM_DLL_EXPORT_TYPED_FUNC.

Posted by GitBox <gi...@apache.org>.
areusch commented on pull request #7338:
URL: https://github.com/apache/tvm/pull/7338#issuecomment-767040951


   @jinchenglee @tqchen 


----------------------------------------------------------------
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.

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



[GitHub] [tvm] jinchenglee commented on pull request #7338: Add resource_handle to TVM_DLL_EXPORT_TYPED_FUNC.

Posted by GitBox <gi...@apache.org>.
jinchenglee commented on pull request #7338:
URL: https://github.com/apache/tvm/pull/7338#issuecomment-767695790


   @areusch , there's another macro in packed_func.h needs same fix:
   
   ```
   #define TVM_DLL_EXPORT_TYPED_FUNC(ExportName, Function)                                     \
     extern "C" {                                                                              \
     TVM_DLL int ExportName(TVMValue* args, int* type_code, int num_args, TVMValue* out_value, \
                            int* out_type_code) {                                              \
       try {                                                                                   \
         auto f = Function;                                                                    \
         using FType = ::tvm::runtime::detail::function_signature<decltype(f)>::FType;         \
         ::tvm::runtime::TVMRetValue rv;                                                       \
         ::tvm::runtime::detail::unpack_call_by_signature<FType>::run(                         \
             f, ::tvm::runtime::TVMArgs(args, type_code, num_args), &rv);                      \
         rv.MoveToCHost(out_value, out_type_code);                                             \
         return 0;                                                                             \
       } catch (const ::std::runtime_error& _except_) {                                        \
         TVMAPISetLastError(_except_.what());                                                  \
         return -1;                                                                            \
       }                                                                                       \
     }                                                                                         \
     }
   ```


----------------------------------------------------------------
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.

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