cconvey commented on code in PR #13569:
URL: https://github.com/apache/tvm/pull/13569#discussion_r1086976058
##########
include/tvm/ir/function.h:
##########
@@ -63,6 +63,43 @@ enum class CallingConv : int {
* - Implementation: defined by device runtime(e.g. runtime/cuda)
*/
kDeviceKernelLaunch = 2,
+ /*!
+ * \brief For functions only called by other functions within the same IR
module.
+ *
+ * This calling convention exists to support one PrimFunc calling another
PrimFunc
+ * within the same IRModule.
+ *
+ * Overview / Purpose:
+ *
+ * - This calling convention is intended only for PrimFuncs whose callers
reside in
+ * the same IRModule. This is the only supported use case.
+ *
+ * - The details of the calling convention may change frequently as TVM
evolves.
+ * Therefore users are discouraged from attempting to use this calling
convention
+ * outside of the supported use case(s).
+ *
+ * Current mechanics / usage requirements:
+ *
+ * - A PrimFunc with this calling convention will NOT undergo any of the
signature
+ * transformations provided by the MakePackedAPI pass.
+ *
+ * - Supported use cases, and their corresponding unit tests, are all
expressed as
+ * TVMScript.
+ *
+ * - The callsite must use `T.call_extern`.
Review Comment:
Thanks for the feedback!
Could you clarify what you mean by "C calling convention" in this context?
I've only heard that term used to describe the mapping of C-language types
to (e.g.) x86-64 ABI -compliant function calls.
But in this PR's context, the question (AFAICT) is how we map TVMScript
callsite arguments to TVMScript formal parameters. So I'm not sure how this
would relate to a C calling convention.
--
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]