We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9f4b888 commit b16f632Copy full SHA for b16f632
mlir/lib/ExecutionEngine/AsyncRuntime.cpp
@@ -59,7 +59,12 @@ mlirAsyncRuntimeAwaitToken(AsyncToken *token) {
59
60
extern "C" MLIR_ASYNCRUNTIME_EXPORT void
61
mlirAsyncRuntimeExecute(CoroHandle handle, CoroResume resume) {
62
+#if LLVM_ENABLE_THREADS
63
+ std::thread thread([handle, resume]() { (*resume)(handle); });
64
+ thread.detach();
65
+#else
66
(*resume)(handle);
67
+#endif
68
}
69
70
mlir/lib/ExecutionEngine/CMakeLists.txt
@@ -107,5 +107,6 @@ add_mlir_library(mlir_async_runtime
107
108
LINK_LIBS PUBLIC
109
mlir_c_runner_utils_static
110
+ ${LLVM_PTHREAD_LIB}
111
)
112
target_compile_definitions(mlir_async_runtime PRIVATE mlir_async_runtime_EXPORTS)
0 commit comments