MCPcopy Create free account
hub / github.com/apache/tvm-ffi / FromPackedInplace

Method FromPackedInplace

include/tvm/ffi/function.h:369–379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367 */
368 template <typename TCallable, typename... Args>
369 static auto FromPackedInplace(Args&&... args) {
370 // We must ensure TCallable is a value type (decay_t) that can hold the callable object
371 static_assert(std::is_same_v<TCallable, std::decay_t<TCallable>>);
372 static_assert(std::is_invocable_v<TCallable, const AnyView*, int32_t, Any*>);
373 using ObjType = details::FunctionObjImpl<TCallable>;
374 Function func;
375 auto obj_ptr = make_object<ObjType>(std::forward<Args>(args)...);
376 auto* call_ptr = obj_ptr->GetCallable();
377 func.data_ = std::move(obj_ptr);
378 return std::make_tuple(std::move(func), call_ptr);
379 }
380
381 /*!
382 * \brief Create ffi::Function from a C style callbacks.

Callers

nothing calls this directly

Calls 1

GetCallableMethod · 0.80

Tested by

no test coverage detected