Closed
Description
There is one side-effect of with
statements: Their effects propagate down the call stack, even into library code. Consider the following code:
# In library.py
@njit(parallel=False)
def library_func(...):
...
# In user.py
with dppl.device_context(gpu):
...
library_func(...)
...
In this case, if the with
statement is preferred, the library loses control of what's executed inside library_func
. Raising an error is okay, IMO, but for this reason, we shouldn't prefer what the with
statement says.
Personally, I'd be okay with changing the default value of parallel
to parallel=unspecified
.
Metadata
Metadata
Assignees
Labels
No labels