diff --git a/examples/cubin_launcher/dynamic_cubin/src/lib_dynamic.cc b/examples/cubin_launcher/dynamic_cubin/src/lib_dynamic.cc index 61f050db..1a393834 100644 --- a/examples/cubin_launcher/dynamic_cubin/src/lib_dynamic.cc +++ b/examples/cubin_launcher/dynamic_cubin/src/lib_dynamic.cc @@ -129,8 +129,8 @@ void MulTwo(tvm::ffi::TensorView x, tvm::ffi::TensorView y) { } // Export TVM-FFI functions -TVM_FFI_DLL_EXPORT_TYPED_FUNC(set_cubin, cubin_dynamic::SetCubin); -TVM_FFI_DLL_EXPORT_TYPED_FUNC(add_one, cubin_dynamic::AddOne); -TVM_FFI_DLL_EXPORT_TYPED_FUNC(mul_two, cubin_dynamic::MulTwo); +TVM_FFI_DLL_EXPORT_TYPED_FUNC(set_cubin, cubin_dynamic::SetCubin) +TVM_FFI_DLL_EXPORT_TYPED_FUNC(add_one, cubin_dynamic::AddOne) +TVM_FFI_DLL_EXPORT_TYPED_FUNC(mul_two, cubin_dynamic::MulTwo) } // namespace cubin_dynamic diff --git a/examples/cubin_launcher/embedded_cubin/cpp_embed/src/lib_embedded.cc b/examples/cubin_launcher/embedded_cubin/cpp_embed/src/lib_embedded.cc index 357522e5..615bdc9b 100644 --- a/examples/cubin_launcher/embedded_cubin/cpp_embed/src/lib_embedded.cc +++ b/examples/cubin_launcher/embedded_cubin/cpp_embed/src/lib_embedded.cc @@ -116,7 +116,7 @@ void MulTwo(tvm::ffi::TensorView x, tvm::ffi::TensorView y) { } // Export TVM-FFI functions -TVM_FFI_DLL_EXPORT_TYPED_FUNC(add_one, cubin_embedded::AddOne); -TVM_FFI_DLL_EXPORT_TYPED_FUNC(mul_two, cubin_embedded::MulTwo); +TVM_FFI_DLL_EXPORT_TYPED_FUNC(add_one, cubin_embedded::AddOne) +TVM_FFI_DLL_EXPORT_TYPED_FUNC(mul_two, cubin_embedded::MulTwo) } // namespace cubin_embedded diff --git a/examples/cubin_launcher/embedded_cubin/embed_with_tvm_ffi/src/lib_embedded.cc b/examples/cubin_launcher/embedded_cubin/embed_with_tvm_ffi/src/lib_embedded.cc index 53401fc6..ea410a60 100644 --- a/examples/cubin_launcher/embedded_cubin/embed_with_tvm_ffi/src/lib_embedded.cc +++ b/examples/cubin_launcher/embedded_cubin/embed_with_tvm_ffi/src/lib_embedded.cc @@ -113,7 +113,7 @@ void MulTwo(tvm::ffi::TensorView x, tvm::ffi::TensorView y) { } // Export TVM-FFI functions -TVM_FFI_DLL_EXPORT_TYPED_FUNC(add_one, cubin_embedded::AddOne); -TVM_FFI_DLL_EXPORT_TYPED_FUNC(mul_two, cubin_embedded::MulTwo); +TVM_FFI_DLL_EXPORT_TYPED_FUNC(add_one, cubin_embedded::AddOne) +TVM_FFI_DLL_EXPORT_TYPED_FUNC(mul_two, cubin_embedded::MulTwo) } // namespace cubin_embedded diff --git a/examples/cubin_launcher/embedded_cubin/include_bin2c/src/lib_embedded.cc b/examples/cubin_launcher/embedded_cubin/include_bin2c/src/lib_embedded.cc index dd8d578f..3c878894 100644 --- a/examples/cubin_launcher/embedded_cubin/include_bin2c/src/lib_embedded.cc +++ b/examples/cubin_launcher/embedded_cubin/include_bin2c/src/lib_embedded.cc @@ -113,7 +113,7 @@ void MulTwo(tvm::ffi::TensorView x, tvm::ffi::TensorView y) { } // Export TVM-FFI functions -TVM_FFI_DLL_EXPORT_TYPED_FUNC(add_one, cubin_embedded::AddOne); -TVM_FFI_DLL_EXPORT_TYPED_FUNC(mul_two, cubin_embedded::MulTwo); +TVM_FFI_DLL_EXPORT_TYPED_FUNC(add_one, cubin_embedded::AddOne) +TVM_FFI_DLL_EXPORT_TYPED_FUNC(mul_two, cubin_embedded::MulTwo) } // namespace cubin_embedded diff --git a/examples/python_packaging/src/extension.cc b/examples/python_packaging/src/extension.cc index fc066250..81fb0039 100644 --- a/examples/python_packaging/src/extension.cc +++ b/examples/python_packaging/src/extension.cc @@ -33,7 +33,7 @@ namespace ffi = tvm::ffi; // [tvm_ffi_abi.begin] static int AddTwo(int x) { return x + 2; } -TVM_FFI_DLL_EXPORT_TYPED_FUNC(add_two, AddTwo); +TVM_FFI_DLL_EXPORT_TYPED_FUNC(add_two, AddTwo) // [tvm_ffi_abi.end] // [global_function.begin] diff --git a/examples/quickstart/compile/add_one_cpu.cc b/examples/quickstart/compile/add_one_cpu.cc index 22ce5e09..3ddf6cf6 100644 --- a/examples/quickstart/compile/add_one_cpu.cc +++ b/examples/quickstart/compile/add_one_cpu.cc @@ -34,6 +34,6 @@ void AddOne(tvm::ffi::TensorView x, tvm::ffi::TensorView y) { } } -TVM_FFI_DLL_EXPORT_TYPED_FUNC(add_one_cpu, tvm_ffi_example_cpu::AddOne); +TVM_FFI_DLL_EXPORT_TYPED_FUNC(add_one_cpu, tvm_ffi_example_cpu::AddOne) } // namespace tvm_ffi_example_cpu // [example.end] diff --git a/include/tvm/ffi/reflection/overload.h b/include/tvm/ffi/reflection/overload.h index f9684bcf..a85174c8 100644 --- a/include/tvm/ffi/reflection/overload.h +++ b/include/tvm/ffi/reflection/overload.h @@ -145,7 +145,8 @@ struct TypedOverload : OverloadBase { private: template - void GetMismatchMessageAux(std::ostringstream& os, const AnyView* args, int32_t num_args) { + void GetMismatchMessageAux(std::ostringstream& os, const AnyView* args, + [[maybe_unused]] int32_t num_args) { if constexpr (I < kNumArgs) { if (this->last_mismatch_index_ == static_cast(I)) { TVMFFIAny any_data = args[I].CopyToTVMFFIAny(); diff --git a/src/ffi/testing/testing.cc b/src/ffi/testing/testing.cc index d38c027c..7ee6ffd7 100644 --- a/src/ffi/testing/testing.cc +++ b/src/ffi/testing/testing.cc @@ -519,7 +519,7 @@ TVM_FFI_STATIC_INIT_BLOCK() { // Exported symbols for metadata testing on DLL-exported functions // ----------------------------------------------------------------------------- // We keep minimal DLL exports here to verify the export mechanism. -TVM_FFI_DLL_EXPORT_TYPED_FUNC(testing_dll_schema_id_int, tvm::ffi::schema_test_impl::schema_id_int); +TVM_FFI_DLL_EXPORT_TYPED_FUNC(testing_dll_schema_id_int, tvm::ffi::schema_test_impl::schema_id_int) // Documentation export TVM_FFI_DLL_EXPORT_TYPED_FUNC(testing_dll_test_add_with_docstring, diff --git a/tests/cpp/test_function.cc b/tests/cpp/test_function.cc index b3879d79..fddb8fd8 100644 --- a/tests/cpp/test_function.cc +++ b/tests/cpp/test_function.cc @@ -275,7 +275,7 @@ TEST(SetRaisedFromCStrParts, TypeError) { int testing_add1(int x) { return x + 1; } -TVM_FFI_DLL_EXPORT_TYPED_FUNC(testing_add1, testing_add1); +TVM_FFI_DLL_EXPORT_TYPED_FUNC(testing_add1, testing_add1) TEST(Func, FromExternC) { // this is the function abi convention diff --git a/tests/python/cpp_src/test_stl.cc b/tests/python/cpp_src/test_stl.cc index d7ed4211..52477ea4 100644 --- a/tests/python/cpp_src/test_stl.cc +++ b/tests/python/cpp_src/test_stl.cc @@ -89,11 +89,11 @@ auto test_function(std::function f) -> std::function { return [fn = std::move(f)] { return fn() + 1; }; } -TVM_FFI_DLL_EXPORT_TYPED_FUNC(test_tuple, test_tuple); -TVM_FFI_DLL_EXPORT_TYPED_FUNC(test_vector, test_vector); -TVM_FFI_DLL_EXPORT_TYPED_FUNC(test_variant, test_variant); -TVM_FFI_DLL_EXPORT_TYPED_FUNC(test_map, test_map); -TVM_FFI_DLL_EXPORT_TYPED_FUNC(test_map_2, test_map_2); -TVM_FFI_DLL_EXPORT_TYPED_FUNC(test_function, test_function); +TVM_FFI_DLL_EXPORT_TYPED_FUNC(test_tuple, test_tuple) +TVM_FFI_DLL_EXPORT_TYPED_FUNC(test_vector, test_vector) +TVM_FFI_DLL_EXPORT_TYPED_FUNC(test_variant, test_variant) +TVM_FFI_DLL_EXPORT_TYPED_FUNC(test_map, test_map) +TVM_FFI_DLL_EXPORT_TYPED_FUNC(test_map_2, test_map_2) +TVM_FFI_DLL_EXPORT_TYPED_FUNC(test_function, test_function) } // namespace diff --git a/tests/python/test_build.cc b/tests/python/test_build.cc index bc6acf10..881f2942 100644 --- a/tests/python/test_build.cc +++ b/tests/python/test_build.cc @@ -38,4 +38,4 @@ void add_one_cpu(tvm::ffi::TensorView x, tvm::ffi::TensorView y) { } } -TVM_FFI_DLL_EXPORT_TYPED_FUNC(add_one_cpu, add_one_cpu); +TVM_FFI_DLL_EXPORT_TYPED_FUNC(add_one_cpu, add_one_cpu)