| 43 | int GetPropertyMask() const final { return Module::kBinarySerializable | Module::kRunnable; }; |
| 44 | |
| 45 | Optional<ffi::Function> GetFunction(const String& name) final { |
| 46 | TVMFFISafeCallType faddr; |
| 47 | faddr = reinterpret_cast<TVMFFISafeCallType>(lib_->GetSymbolWithSymbolPrefix(name)); |
| 48 | // ensure the function keeps the Library Module alive |
| 49 | Module self_strong_ref = GetRef<Module>(this); |
| 50 | if (faddr != nullptr) { |
| 51 | return ffi::Function::FromPacked([faddr, self_strong_ref](ffi::PackedArgs args, |
| 52 | ffi::Any* rv) { |
| 53 | TVM_FFI_ICHECK_LT(rv->type_index(), ffi::TypeIndex::kTVMFFIStaticObjectBegin); |
| 54 | TVM_FFI_CHECK_SAFE_CALL((*faddr)(nullptr, reinterpret_cast<const TVMFFIAny*>(args.data()), |
| 55 | args.size(), reinterpret_cast<TVMFFIAny*>(rv))); |
| 56 | }); |
| 57 | } |
| 58 | return std::nullopt; |
| 59 | } |
| 60 | |
| 61 | Optional<String> GetFunctionMetadata(const String& name) final { |
| 62 | // Look for __tvm_ffi__metadata_<name> symbol |
nothing calls this directly
no test coverage detected