DarkSharpness commented on PR #229: URL: https://github.com/apache/tvm-ffi/pull/229#issuecomment-3498898328
It seems that restricting to `T`, `const T` and `const T &` will cause a compile error in tvm-ffi source code when `pip install -ve`. That's because some part of tvm-ffi source code (like [this](https://github.com/apache/tvm-ffi/blob/main/include/tvm/ffi/reflection/registry.h#L580)) passes a function that accepts a rvalue reference type. So I keeps the support for `T &&`. @yaoyaoding Now, for unsupported types, we directly give the following error (and that's the only error): ``` In file included from /root/tvm-ffi/python/tvm_ffi/../../include/tvm/ffi/function.h:30, from /root/tvm-ffi/python/tvm_ffi/../../include/tvm/ffi/dtype.h:29, from /root/tvm-ffi/python/tvm_ffi/../../include/tvm/ffi/container/tensor.h:29, from /root/.cache/tvm-ffi/test_sbind_760f1ab214615fe2/main.cpp:1: /root/tvm-ffi/python/tvm_ffi/../../include/tvm/ffi/function_details.h: In instantiation of ‘class tvm::ffi::details::ArgValueWithContext<int&, false>’: /root/tvm-ffi/python/tvm_ffi/../../include/tvm/ffi/function_details.h:226:14: required from ‘void tvm::ffi::details::unpack_call(std::index_sequence<Is ...>, const std::string*, const F&, const tvm::ffi::AnyView*, int32_t, tvm::ffi::Any*) [with R = int; long unsigned int ...Is = {0}; F = int(int&); std::index_sequence<Is ...> = std::integer_sequence<long unsigned int, 0>; std::string = std::__cxx11::basic_string<char>; int32_t = int]’ /root/.cache/tvm-ffi/test_sbind_760f1ab214615fe2/main.cpp:17:1: required from here /root/tvm-ffi/python/tvm_ffi/../../include/tvm/ffi/function_details.h:193:7: error: static assertion failed: Argument type in FFI function signature can only be T, const T, or const T& or T&& 193 | TypeSupported<Type>, | ^~~~~~~~~~~~~~~~~~~ /root/tvm-ffi/python/tvm_ffi/../../include/tvm/ffi/function_details.h:193:7: note: ‘tvm::ffi::details::TypeSupported<int&>’ evaluates to false ninja: build stopped: subcommand failed. ``` -- 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]
