Skip to content

Commit a557554

Browse files
committed
Raise error if disable_multithreading and thread_pool is given
1 parent e648301 commit a557554

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

mlir/python/mlir/_mlir_libs/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,13 @@ def __init__(
155155
self.append_dialect_registry(get_dialect_registry())
156156
for hook in post_init_hooks:
157157
hook(self)
158+
if disable_multithreading and thread_pool is not None:
159+
raise ValueError(
160+
"Context constructor has given thread_pool argument, "
161+
"but disable_multithreading flag is True. "
162+
"Please, set thread_pool argument to None or "
163+
"set disable_multithreading flag to False."
164+
)
158165
if not disable_multithreading:
159166
if thread_pool is None:
160167
self.enable_multithreading(True)

0 commit comments

Comments
 (0)