Commit e3365445 by Jared Roesch Committed by Tianqi Chen

[FIX] Fix issue with TypedPackedFunc template instatition (#1649)

parent 3dbc0d64
...@@ -180,9 +180,7 @@ class TypedPackedFunc<R(Args...)> { ...@@ -180,9 +180,7 @@ class TypedPackedFunc<R(Args...)> {
* *
* \param packed The packed function * \param packed The packed function
*/ */
explicit TypedPackedFunc(PackedFunc packed) inline explicit TypedPackedFunc(PackedFunc packed);
: packed_(packed) {
}
/*! /*!
* \brief construct from a lambda function with the same signature. * \brief construct from a lambda function with the same signature.
* *
...@@ -925,6 +923,8 @@ inline PackedFunc::FType PackedFunc::body() const { ...@@ -925,6 +923,8 @@ inline PackedFunc::FType PackedFunc::body() const {
return body_; return body_;
} }
// internal namespace // internal namespace
namespace detail { namespace detail {
...@@ -1132,6 +1132,10 @@ struct typed_packed_call_dispatcher<void> { ...@@ -1132,6 +1132,10 @@ struct typed_packed_call_dispatcher<void> {
} // namespace detail } // namespace detail
template<typename R, typename ...Args> template<typename R, typename ...Args>
TypedPackedFunc<R(Args...)>::TypedPackedFunc(PackedFunc packed)
: packed_(packed) {}
template<typename R, typename ...Args>
template<typename FType> template<typename FType>
inline void TypedPackedFunc<R(Args...)>::AssignTypedLambda(FType flambda) { inline void TypedPackedFunc<R(Args...)>::AssignTypedLambda(FType flambda) {
packed_ = PackedFunc([flambda](const TVMArgs& args, TVMRetValue* rv) { packed_ = PackedFunc([flambda](const TVMArgs& args, TVMRetValue* rv) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment