tkonolige commented on a change in pull request #7152:
URL: https://github.com/apache/tvm/pull/7152#discussion_r552886650
##########
File path: include/tvm/runtime/packed_func.h
##########
@@ -442,13 +447,17 @@ class TVMPODValue_ {
protected:
friend class TVMArgsSetter;
friend class TVMRetValue;
+ friend class TVMMovableArgValue_;
TVMPODValue_() : type_code_(kTVMNullptr) {}
- TVMPODValue_(TVMValue value, int type_code) : value_(value),
type_code_(type_code) {}
+ TVMPODValue_(TVMValue value, int type_code, const std::string&
prefix_message = "")
+ : value_(value), type_code_(type_code), prefix_message_(prefix_message)
{}
/*! \brief The value */
TVMValue value_;
/*! \brief the type code */
int type_code_;
+ /*! \brief Message to prefix any error message with */
+ std::string prefix_message_;
Review comment:
> Instead, it might be good to think about alternatives. E.g. trying to
be able to catch the errors in FFI functions and add name to the trace.
This code gives error messages when the arguments cannot be converted
correctly. It prints which argument does not match. I don't see how catching
errors at the FFI can tell us which argument was incorrect.
The only other approach I can think of is manually converting each argument
before we call the function. This would be a much larger change and would
probably involve some template magic.
----------------------------------------------------------------
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:
[email protected]