Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Legion Fills when possible #604

Merged
merged 2 commits into from
Sep 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions cunumeric/deferred.py
Original file line number Diff line number Diff line change
Expand Up @@ -1289,21 +1289,24 @@ def fft(
# Fill the cuNumeric array with the value in the numpy array
def _fill(self, value: Any) -> None:
assert value.scalar
assert self.base is not None

if self.scalar:
# Handle the 0D case special
self.base.set_storage(value.storage)
elif self.dtype.kind != "V" and self.base.kind is not Future:
# Emit a Legion fill
fill = self.context.create_fill(self.base, value)
fill.execute()
else:
assert self.base is not None
# Perform the fill using a task
# If this is a fill for an arg value, make sure to pass
# the value dtype so that we get it packed correctly
argval = self.dtype.kind == "V"

task = self.context.create_auto_task(CuNumericOpCode.FILL)
task.add_output(self.base)
task.add_input(value)
task.add_scalar_arg(argval, bool)

task.execute()

def fill(self, numpy_array: Any) -> None:
Expand Down