gemini-code-assist[bot] commented on code in PR #358:
URL: https://github.com/apache/tvm-ffi/pull/358#discussion_r2640797238
##########
docs/packaging/python_packaging.rst:
##########
@@ -144,6 +144,17 @@ It registry handles type translation, error handling, and
metadata.
def add_one(x: int) -> int: ...
+.. note::
+
+ Global functions can be retrieved via :py:func:`tvm_ffi.get_global_func` in
Python, :cpp:func:`TVMFFIFunctionGetGlobal` in C,
+ or :cpp:func:`tvm::ffi::Function::GetGlobal` in C++.
Review Comment:

The C function `TVMFFIFunctionGetGlobal` should be referenced using the C
domain, i.e., `:c:func:`. Using `:cpp:func:` is for C++ functions.
```suggestion
Global functions can be retrieved via :py:func:`tvm_ffi.get_global_func`
in Python, :c:func:`TVMFFIFunctionGetGlobal` in C,
or :cpp:func:`tvm::ffi::Function::GetGlobal` in C++.
```
##########
examples/python_packaging/src/extension.cc:
##########
@@ -38,6 +38,7 @@ TVM_FFI_DLL_EXPORT_TYPED_FUNC(add_two, AddTwo);
// [global_function.begin]
static int AddOne(int x) { return x + 1; }
+// [global_function.end]
Review Comment:

By moving `// [global_function.end]` here, the code snippet included in the
documentation no longer shows the registration of the `AddOne` function using
`tvm::ffi::reflection::GlobalDef`. This makes the accompanying text in
`docs/packaging/python_packaging.rst` confusing, as it specifically describes
this registration process. For consistency with other examples in the document
(like the `Class` example which shows both definition and registration), it
would be better to include the registration block. Please consider reverting
this change and the corresponding removal of the tag at the end of the
`TVM_FFI_STATIC_INIT_BLOCK`.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]