Skip to content

Commit 49a8ba0

Browse files
committed
more detailed docs for py and c
1 parent 128bf5d commit 49a8ba0

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

mlir/include/mlir-c/ExecutionEngine.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ MLIR_CAPI_EXPORTED MlirExecutionEngine mlirExecutionEngineCreate(
4646
MlirModule op, int optLevel, int numPaths,
4747
const MlirStringRef *sharedLibPaths, bool enableObjectDump);
4848

49-
/// Execute the global constructors from the module.
49+
/// Initialize the ExecutionEngine. Global constructors specified by
50+
/// `llvm.mlir.global_ctors` will be run. One common scenario is that kernel
51+
/// binary compiled from `gpu.module` gets loaded during initialization. Make
52+
/// sure all symbols are resolvable before initialization by calling
53+
/// `mlirExecutionEngineRegisterSymbol` or including shared libraries.
5054
MLIR_CAPI_EXPORTED void mlirExecutionEngineInitialize(MlirExecutionEngine jit);
5155

5256
/// Destroy an ExecutionEngine instance.

mlir/lib/Bindings/Python/ExecutionEngineModule.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,12 @@ NB_MODULE(_mlirExecutionEngine, m) {
129129
[](PyExecutionEngine &executionEngine) {
130130
mlirExecutionEngineInitialize(executionEngine.get());
131131
},
132-
"Initialize the ExecutionEngine.")
132+
"Initialize the ExecutionEngine. Global constructors specified by "
133+
"`llvm.mlir.global_ctors` will be run. One common scenario is that "
134+
"kernel binary compiled from `gpu.module` gets loaded during "
135+
"initialization. Make sure all symbols are resolvable before "
136+
"initialization by calling `raw_register_runtime` or including "
137+
"shared libraries.")
133138
.def(
134139
"dump_to_object_file",
135140
[](PyExecutionEngine &executionEngine, const std::string &fileName) {

0 commit comments

Comments
 (0)