tqchen commented on code in PR #13569:
URL: https://github.com/apache/tvm/pull/13569#discussion_r1085730953


##########
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:
   One minor note, we might want to think a bit about possible intrinsics here, 
given call_extern already have semantics that normally assumes(C semantics). It 
might be preferrable to have a different intrinsic.



-- 
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-unsubscr...@tvm.apache.org

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

Reply via email to