Export the module and all imported modules into a single device library. This function only works on host LLVM modules, other runtime::Module subclasses will work with this API but they must support implement the save and load mechanisms of modules completely includ
(
self,
file_name,
*,
fcompile=None,
addons=None,
workspace_dir=None,
**kwargs,
)
| 115 | return self._jitted_mod |
| 116 | |
| 117 | def export_library( |
| 118 | self, |
| 119 | file_name, |
| 120 | *, |
| 121 | fcompile=None, |
| 122 | addons=None, |
| 123 | workspace_dir=None, |
| 124 | **kwargs, |
| 125 | ): |
| 126 | """ |
| 127 | Export the module and all imported modules into a single device library. |
| 128 | |
| 129 | This function only works on host LLVM modules, other runtime::Module |
| 130 | subclasses will work with this API but they must support implement |
| 131 | the save and load mechanisms of modules completely including saving |
| 132 | from streams and files. This will pack your non-shared library module |
| 133 | into a single shared library which can later be loaded by TVM. |
| 134 | |
| 135 | Parameters |
| 136 | ---------- |
| 137 | file_name : str |
| 138 | The name of the shared library. |
| 139 | |
| 140 | fcompile : function(target, file_list, kwargs), optional |
| 141 | The compilation function to use create the final library object during |
| 142 | export. |
| 143 | |
| 144 | For example, when fcompile=_cc.create_shared, or when it is not supplied but |
| 145 | module is "llvm," this is used to link all produced artifacts |
| 146 | into a final dynamic library. |
| 147 | |
| 148 | This behavior is controlled by the type of object exported. |
| 149 | If fcompile has attribute object_format, will compile host library |
| 150 | to that format. Otherwise, will use default format "o". |
| 151 | |
| 152 | addons : list of str, optional |
| 153 | Additional object files to link against. |
| 154 | |
| 155 | workspace_dir : str, optional |
| 156 | The path of the directory used to create the intermediate |
| 157 | artifacts when exporting the module. |
| 158 | If this is not provided a temporary dir will be created. |
| 159 | |
| 160 | kwargs : dict, optional |
| 161 | Additional arguments passed to fcompile |
| 162 | |
| 163 | Returns |
| 164 | ------- |
| 165 | result of fcompile() : unknown, optional |
| 166 | If the compilation function returns an artifact it would be returned via |
| 167 | export_library, if any. |
| 168 | """ |
| 169 | return self.mod.export_library( |
| 170 | file_name, |
| 171 | fcompile=fcompile, |
| 172 | addons=addons, |
| 173 | workspace_dir=workspace_dir, |
| 174 | **kwargs, |
no outgoing calls