-
Notifications
You must be signed in to change notification settings - Fork 37
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
tvm-ffi/include/tvm/ffi/function.h
Lines 714 to 718 in 7f3f872
| template <typename FLambda, | |
| typename = std::enable_if_t<std::is_convertible_v<FLambda, std::function<R(Args...)>>>> | |
| TypedFunction(const FLambda& typed_lambda) { // NOLINT(*) | |
| packed_ = Function::FromTyped(typed_lambda); | |
| } |
When constructed from C++ functions, this will lead to one unnecessary copy. A quick example is the code in PR #228 (support for STL), where we construct TypedFunction from native C++ functions.
A (hopefully) better implementation can be use perfect forwarding for all types except for TypeFunction itself.
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested