Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 7, 2024
1 parent b83cf2d commit 434f8c0
Show file tree
Hide file tree
Showing 18 changed files with 189 additions and 180 deletions.
8 changes: 5 additions & 3 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ def flatten(list):

option_strings = flatten(
[
[opt, "--no-" + opt[2:], "--no" + opt[2:]]
if opt.startswith("--")
else [opt]
(
[opt, "--no-" + opt[2:], "--no" + opt[2:]]
if opt.startswith("--")
else [opt]
)
for opt in option_strings
]
)
Expand Down
80 changes: 50 additions & 30 deletions legate/core/_legion/operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,9 +795,11 @@ def add_src_requirement(
projection,
legion.LEGION_READ_ONLY,
coherence,
upper_bound.get_root().handle
if parent is None
else parent.handle,
(
upper_bound.get_root().handle
if parent is None
else parent.handle
),
tag,
False,
)
Expand All @@ -808,9 +810,11 @@ def add_src_requirement(
projection,
legion.LEGION_READ_ONLY,
coherence,
upper_bound.get_root().handle
if parent is None
else parent.handle,
(
upper_bound.get_root().handle
if parent is None
else parent.handle
),
tag,
False,
)
Expand Down Expand Up @@ -874,9 +878,11 @@ def add_dst_requirement(
projection,
privilege,
coherence,
upper_bound.get_root().handle
if parent is None
else parent.handle,
(
upper_bound.get_root().handle
if parent is None
else parent.handle
),
tag,
False,
)
Expand All @@ -887,9 +893,11 @@ def add_dst_requirement(
projection,
redop,
coherence,
upper_bound.get_root().handle
if parent is None
else parent.handle,
(
upper_bound.get_root().handle
if parent is None
else parent.handle
),
tag,
False,
)
Expand All @@ -901,9 +909,11 @@ def add_dst_requirement(
projection,
privilege,
coherence,
upper_bound.get_root().handle
if parent is None
else parent.handle,
(
upper_bound.get_root().handle
if parent is None
else parent.handle
),
tag,
False,
)
Expand All @@ -914,9 +924,11 @@ def add_dst_requirement(
projection,
redop,
coherence,
upper_bound.get_root().handle
if parent is None
else parent.handle,
(
upper_bound.get_root().handle
if parent is None
else parent.handle
),
tag,
False,
)
Expand Down Expand Up @@ -980,9 +992,11 @@ def add_src_indirect_requirement(
field.fid if isinstance(field, FieldID) else field,
),
coherence,
upper_bound.get_root().handle
if parent is None
else parent.handle,
(
upper_bound.get_root().handle
if parent is None
else parent.handle
),
tag,
is_range,
False,
Expand All @@ -997,9 +1011,11 @@ def add_src_indirect_requirement(
field.fid if isinstance(field, FieldID) else field,
),
coherence,
upper_bound.get_root().handle
if parent is None
else parent.handle,
(
upper_bound.get_root().handle
if parent is None
else parent.handle
),
tag,
is_range,
False,
Expand Down Expand Up @@ -1053,9 +1069,11 @@ def add_dst_indirect_requirement(
field.fid if isinstance(field, FieldID) else field,
),
coherence,
upper_bound.get_root().handle
if parent is None
else parent.handle,
(
upper_bound.get_root().handle
if parent is None
else parent.handle
),
tag,
is_range,
False,
Expand All @@ -1070,9 +1088,11 @@ def add_dst_indirect_requirement(
field.fid if isinstance(field, FieldID) else field,
),
coherence,
upper_bound.get_root().handle
if parent is None
else parent.handle,
(
upper_bound.get_root().handle
if parent is None
else parent.handle
),
tag,
is_range,
False,
Expand Down
24 changes: 15 additions & 9 deletions legate/core/_legion/region.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,11 @@ def __init__(
existing.handle,
legion.LEGION_WRITE_DISCARD,
coherence,
existing.get_root().handle
if parent is None
else parent.handle,
(
existing.get_root().handle
if parent is None
else parent.handle
),
tag,
False,
)
Expand All @@ -259,9 +261,11 @@ def __init__(
proj,
legion.LEGION_WRITE_DISCARD,
coherence,
existing.get_root().handle
if parent is None
else parent.handle,
(
existing.get_root().handle
if parent is None
else parent.handle
),
tag,
False,
)
Expand All @@ -287,9 +291,11 @@ def __init__(
proj,
legion.LEGION_WRITE_DISCARD,
coherence,
existing.get_root().handle
if parent is None
else parent.handle,
(
existing.get_root().handle
if parent is None
else parent.handle
),
tag,
False,
)
Expand Down
80 changes: 50 additions & 30 deletions legate/core/_legion/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,9 +603,11 @@ def add_no_access_requirement(
projection,
legion.LEGION_NO_ACCESS,
coherence,
upper_bound.get_root().handle
if parent is None
else parent.handle,
(
upper_bound.get_root().handle
if parent is None
else parent.handle
),
tag,
False,
)
Expand All @@ -616,9 +618,11 @@ def add_no_access_requirement(
projection,
legion.LEGION_NO_ACCESS,
coherence,
upper_bound.get_root().handle
if parent is None
else parent.handle,
(
upper_bound.get_root().handle
if parent is None
else parent.handle
),
tag,
False,
)
Expand Down Expand Up @@ -679,9 +683,11 @@ def add_read_requirement(
projection,
legion.LEGION_READ_ONLY,
coherence,
upper_bound.get_root().handle
if parent is None
else parent.handle,
(
upper_bound.get_root().handle
if parent is None
else parent.handle
),
tag,
False,
)
Expand All @@ -692,9 +698,11 @@ def add_read_requirement(
projection,
legion.LEGION_READ_ONLY,
coherence,
upper_bound.get_root().handle
if parent is None
else parent.handle,
(
upper_bound.get_root().handle
if parent is None
else parent.handle
),
tag,
False,
)
Expand Down Expand Up @@ -755,9 +763,11 @@ def add_write_requirement(
projection,
legion.LEGION_WRITE_DISCARD,
coherence,
upper_bound.get_root().handle
if parent is None
else parent.handle,
(
upper_bound.get_root().handle
if parent is None
else parent.handle
),
tag,
False,
)
Expand All @@ -768,9 +778,11 @@ def add_write_requirement(
projection,
legion.LEGION_WRITE_DISCARD,
coherence,
upper_bound.get_root().handle
if parent is None
else parent.handle,
(
upper_bound.get_root().handle
if parent is None
else parent.handle
),
tag,
False,
)
Expand Down Expand Up @@ -831,9 +843,11 @@ def add_read_write_requirement(
projection,
legion.LEGION_READ_WRITE,
coherence,
upper_bound.get_root().handle
if parent is None
else parent.handle,
(
upper_bound.get_root().handle
if parent is None
else parent.handle
),
tag,
False,
)
Expand All @@ -844,9 +858,11 @@ def add_read_write_requirement(
projection,
legion.LEGION_READ_WRITE,
coherence,
upper_bound.get_root().handle
if parent is None
else parent.handle,
(
upper_bound.get_root().handle
if parent is None
else parent.handle
),
tag,
False,
)
Expand Down Expand Up @@ -908,9 +924,11 @@ def add_reduction_requirement(
projection,
redop,
coherence,
upper_bound.get_root().handle
if parent is None
else parent.handle,
(
upper_bound.get_root().handle
if parent is None
else parent.handle
),
tag,
False,
)
Expand All @@ -921,9 +939,11 @@ def add_reduction_requirement(
projection,
redop,
coherence,
upper_bound.get_root().handle
if parent is None
else parent.handle,
(
upper_bound.get_root().handle
if parent is None
else parent.handle
),
tag,
False,
)
Expand Down
6 changes: 2 additions & 4 deletions legate/core/_legion/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,11 @@ def launch(
runtime: legion.legion_runtime_t,
context: legion.legion_context_t,
**kwargs: Any,
) -> T:
...
) -> T: ...


class Mappable(Protocol):
def set_mapper_arg(self, data: Any, size: int) -> None:
...
def set_mapper_arg(self, data: Any, size: int) -> None: ...


# todo: (bev) use list[...] when feasible
Expand Down
9 changes: 3 additions & 6 deletions legate/core/communicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,13 @@ def destroy(self) -> None:
self._handles = {}

@abstractproperty
def needs_barrier(self) -> bool:
...
def needs_barrier(self) -> bool: ...

@abstractmethod
def _initialize(self, volume: int) -> FutureMap:
...
def _initialize(self, volume: int) -> FutureMap: ...

@abstractmethod
def _finalize(self, volume: int, handle: FutureMap) -> None:
...
def _finalize(self, volume: int, handle: FutureMap) -> None: ...


class NCCLCommunicator(Communicator):
Expand Down
Loading

0 comments on commit 434f8c0

Please sign in to comment.