tvm_ffi

Module static_init

Source
Expand description

Static init blocks: code that runs when the program or library that holds it loads, as a C++ TVM_FFI_STATIC_INIT_BLOCK does. The blocks of a program or library are gathered at link time, wherever in it they are, and a constructor runs them when it loads. Once Python loads a library built on this crate, by any means, it sees what the blocks registered, as it sees the registrations of a C++ library. A block that several libraries of a process have, as each links its own copy of a crate they share, runs once. See static_init_block!.

Functionsยง

  • Run every static_init_block! of this program or library that has not run, in the order of their modules and lines; running again does nothing. Every block is tried, and the error lists those that failed. A block that another library of the process has run, from the same version of its crate and the same text, is skipped: libraries that link the same crate register what its blocks define once.