Skip to content

Commit

Permalink
Merge pull request #263 from clEsperanto/git-bob-mod-8rItDeektA
Browse files Browse the repository at this point in the history
Rename parameter "bool" to "wait_for_kernel_finish" to solve issue #262.
  • Loading branch information
StRigaud authored Oct 16, 2024
2 parents a2dd16c + a5a6a27 commit 2f51de2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions pyclesperanto/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def select_backend(backend: str = "opencl") -> str:
return f"{BackendManager.get_backend()} selected."


def wait_for_kernel_to_finish(flag: bool = True, device: Device = None):
def wait_for_kernel_to_finish(wait: bool = True, device: Device = None):
"""Wait for kernel to finish
Enforce the system to wait for the kernel to finish before continuing. Introducing a
Expand All @@ -135,15 +135,15 @@ def wait_for_kernel_to_finish(flag: bool = True, device: Device = None):
Parameters
----------
flag : bool, default = True
wait : bool, default = True
if True, wait for kernel to finish
device : Device, default = None
the device to set the flag. If None, set it to the current device
"""
if device is None:
get_device().set_wait_to_finish(flag)
get_device().set_wait_to_finish(wait)
else:
device.set_wait_to_finish(flag)
device.set_wait_to_finish(wait)


def default_initialisation():
Expand Down
4 changes: 2 additions & 2 deletions pyclesperanto/_interroperability.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ def affine_transform(
)


def set_wait_for_kernel_finish(bool=True):
def set_wait_for_kernel_finish(wait: bool = True):
warnings.warn(
"set_wait_for_kernel_finish : This method is deprecated. Consider using wait_for_kernel_to_finish() instead.",
DeprecationWarning,
)
wait_for_kernel_to_finish(bool)
wait_for_kernel_to_finish(wait)


def clip(a, a_min, a_max, out=None):
Expand Down

0 comments on commit 2f51de2

Please sign in to comment.