This is an automated email from the ASF dual-hosted git repository.
tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm-ffi.git
The following commit(s) were added to refs/heads/main by this push:
new 05e3a7c5 [FFI] Accept const arguments in TVMFFIFunctionCall (#978)
05e3a7c5 is described below
commit 05e3a7c5568b5e21c92f50aa7b916fe25e674b61
Author: miyan <[email protected]>
AuthorDate: Tue Nov 24 07:30:36 2026 +0800
[FFI] Accept const arguments in TVMFFIFunctionCall (#978)
---
include/tvm/ffi/c_api.h | 2 +-
python/tvm_ffi/cython/base.pxi | 2 +-
src/ffi/function.cc | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/tvm/ffi/c_api.h b/include/tvm/ffi/c_api.h
index 4d8a2f72..550d4227 100644
--- a/include/tvm/ffi/c_api.h
+++ b/include/tvm/ffi/c_api.h
@@ -755,7 +755,7 @@ TVM_FFI_DLL int TVMFFIAnyViewToOwnedAny(const TVMFFIAny*
any_view, TVMFFIAny* ou
* \param result The output result, caller must ensure result->type_index is
set to kTVMFFINone.
* \return 0 on success, nonzero on failure.
*/
-TVM_FFI_DLL int TVMFFIFunctionCall(TVMFFIObjectHandle func, TVMFFIAny* args,
int32_t num_args,
+TVM_FFI_DLL int TVMFFIFunctionCall(TVMFFIObjectHandle func, const TVMFFIAny*
args, int32_t num_args,
TVMFFIAny* result);
/*!
diff --git a/python/tvm_ffi/cython/base.pxi b/python/tvm_ffi/cython/base.pxi
index cff5422b..ef84a517 100644
--- a/python/tvm_ffi/cython/base.pxi
+++ b/python/tvm_ffi/cython/base.pxi
@@ -288,7 +288,7 @@ cdef extern from "tvm/ffi/c_api.h":
int TVMFFIObjectCreateOpaque(void* handle, int32_t type_index,
void (*deleter)(void*), TVMFFIObjectHandle*
out) nogil
int TVMFFIObjectGetTypeIndex(TVMFFIObjectHandle obj) nogil
- int TVMFFIFunctionCall(TVMFFIObjectHandle func, TVMFFIAny* args, int32_t
num_args,
+ int TVMFFIFunctionCall(TVMFFIObjectHandle func, const TVMFFIAny* args,
int32_t num_args,
TVMFFIAny* result) nogil
int TVMFFIFunctionCreate(void* self, TVMFFISafeCallType safe_call,
void (*deleter)(void*), TVMFFIObjectHandle* out)
nogil
diff --git a/src/ffi/function.cc b/src/ffi/function.cc
index 98c8dc1f..a383ba8c 100644
--- a/src/ffi/function.cc
+++ b/src/ffi/function.cc
@@ -188,7 +188,7 @@ int TVMFFIFunctionGetGlobal(const TVMFFIByteArray* name,
TVMFFIObjectHandle* out
TVM_FFI_SAFE_CALL_END();
}
-int TVMFFIFunctionCall(TVMFFIObjectHandle func, TVMFFIAny* args, int32_t
num_args,
+int TVMFFIFunctionCall(TVMFFIObjectHandle func, const TVMFFIAny* args, int32_t
num_args,
TVMFFIAny* result) {
using namespace tvm::ffi;
#ifdef _MSC_VER