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

Method GetGlobal

include/tvm/ffi/function.h:409–419  ·  view source on GitHub ↗

! * \brief Get global function by name * \param name The function name * \return The global function. * \note This function will return std::nullopt if the function is not found. */

Source from the content-addressed store, hash-verified

407 * \note This function will return std::nullopt if the function is not found.
408 */
409 static std::optional<Function> GetGlobal(std::string_view name) {
410 TVMFFIObjectHandle handle;
411 TVMFFIByteArray name_arr{name.data(), name.size()};
412 TVM_FFI_CHECK_SAFE_CALL(TVMFFIFunctionGetGlobal(&name_arr, &handle));
413 if (handle != nullptr) {
414 return Function(
415 details::ObjectUnsafe::ObjectPtrFromOwned<FunctionObj>(static_cast<Object*>(handle)));
416 } else {
417 return std::nullopt;
418 }
419 }
420
421 /*!
422 * \brief Get global function by name

Callers

nothing calls this directly

Calls 5

TVMFFIFunctionGetGlobalFunction · 0.85
lengthMethod · 0.80
FunctionClass · 0.70
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected