Class FunctionObj#

Inheritance Relationships#

Base Types#

Class Documentation#

class FunctionObj : public tvm::ffi::Object, public TVMFFIFunctionCell#

Object container class that backs ffi::Function.

Note

Do not use this class directly, use ffi::Function

Public Types

typedef void (*FCall)(const FunctionObj*, const AnyView*, int32_t, Any*)#

Typedef for C++ style calling signature that comes with exception propagation.

Public Functions

inline void CallPacked(const AnyView *args, int32_t num_args, Any *result) const#

Call the function in packed format.

Parameters:
  • args – The arguments

  • num_args – The number of arguments

  • result – The return value.

Public Members

void *cpp_call#

A function pointer to an underlying cpp call.

The signature is the same as TVMFFISafeCallType except the return type is void, and the function throws exception directly instead of returning error code. We use void* here to avoid depending on c++ compiler.

This pointer should be set to NULL for functions that are not originally created in cpp.

Note

The caller must assume the same cpp exception catching abi when using this pointer. When used across FFI boundaries, always use safe_call.

TVMFFISafeCallType safe_call#

A C API compatible call with exception catching.

Protected Functions

inline FunctionObj()#

Make default constructor protected.

Friends

friend class Function