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

New dependency and nest constraint semantics development (PR v2) #202

Open
wants to merge 168 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
ad45361
improved encapsulation approach for LexSchedule and map creation; imp…
jdsteve2 Apr 14, 2020
1ce8170
adding updated and stripped down checker/__init__ (with aforementione…
jdsteve2 Apr 14, 2020
387a8f1
add test for LexSchedule creation and conversion of LexSchedule into …
jdsteve2 Apr 14, 2020
17e14b1
add docstrings for get_schedule_for_statement_pair() and get_isl_maps…
jdsteve2 Apr 14, 2020
dc45709
remove get_statement_ordering_map() (won't be part of this MR)
jdsteve2 Apr 14, 2020
ee59915
remove lexicographic_order_map (not used in this MR)
jdsteve2 Apr 14, 2020
5401383
remove get_lex_order_map_for_sched_space() (not part of this MR)
jdsteve2 Apr 14, 2020
7e94f4b
remove more methods from LexSchedule that are not used in this MR (lo…
jdsteve2 Apr 14, 2020
16afc55
remove another func from utils that is not used in this MR (append_ma…
jdsteve2 Apr 14, 2020
d2f94b7
remove LexScheduleStatement methods not needed in this MR
jdsteve2 Apr 14, 2020
aa44009
fixing flake8 issues
jdsteve2 Apr 14, 2020
08e7342
adding LexScheduleStatement.__eq__ back in to see if it fixes caching…
jdsteve2 Apr 14, 2020
0574452
Merge branch 'master' into lexschedule-and-map-creation
jdsteve2 Apr 14, 2020
5f53d50
eliminate duplicate code in sched.__str__
jdsteve2 Apr 17, 2020
5441bfa
eliminate duplicate code in sched.create_isl_maps
jdsteve2 Apr 17, 2020
31c68b7
eliminate duplicate code in sched.pad_lex_pts_with_zeros
jdsteve2 Apr 17, 2020
da919bf
eliminate duplicate code in sched.__init__
jdsteve2 Apr 17, 2020
7d291b0
allow for all valid linearization orders in LexSchedule/map creation …
jdsteve2 Apr 20, 2020
de3f00c
updated LexSchedule documentation
jdsteve2 Apr 26, 2020
948ada8
simplify+shorten code for getting+returning maps from schedule
jdsteve2 Apr 26, 2020
217d480
remove underscores from function names if functions are used in separ…
jdsteve2 Apr 27, 2020
70ec6a1
don't pass before/after insn_ids to get_isl_maps_for_LexSchedule(), i…
jdsteve2 Apr 27, 2020
af72169
add TODO for future consideration of generalizing LexSchedule to allo…
jdsteve2 Apr 27, 2020
28c7425
Merge branch 'new-dependency-and-nest-constraint-semantics-developmen…
jdsteve2 Apr 27, 2020
98d744d
remove no-longer-used arg from create_symbolic_isl_map_from_tuples()
jdsteve2 May 5, 2020
ef79ff1
make var names begin wtih and remove variable/check
jdsteve2 May 5, 2020
ec11b2f
change _lp previx to _lp_sched (add sub-prefix)
jdsteve2 May 5, 2020
e44e1cc
Merge branch 'master' into lexschedule-and-map-creation
jdsteve2 May 19, 2020
09a98e6
Merge branch 'new-dependency-and-nest-constraint-semantics-developmen…
jdsteve2 May 20, 2020
d7359f6
Merge branch 'new-dependency-and-nest-constraint-semantics-developmen…
jdsteve2 May 25, 2020
767e821
in docstring for LexScheduleStatement, describe usage of int_id
jdsteve2 May 25, 2020
9d52cc9
remove within_inames attribute from LexScheduleStatement()
jdsteve2 May 25, 2020
a191131
Apply suggestion to loopy/schedule/checker/schedule.py
jdsteve2 May 25, 2020
bcef27a
rename {lex_pt->lex_points, pad_lex_pts_with_zeros->pad_lex_tuples_wi…
jdsteve2 May 26, 2020
7cc557e
rename LexScheduleStatementInstance->LexScheduleStatementInstanceSet …
jdsteve2 May 26, 2020
2f69426
remove comments with redundant documentation
jdsteve2 May 26, 2020
2f494a2
update more comments to clarify that the lex tuples represent *multip…
jdsteve2 May 26, 2020
c71a0ef
clarify what a LexScheduleStatementInstanceSet is
jdsteve2 May 26, 2020
492e1f7
rename LexScheduleStatement->PairwiseScheduleStatement, get_isl_maps_…
jdsteve2 May 26, 2020
e5146b0
change a few variable names to be consistent with name changes for Le…
jdsteve2 May 26, 2020
d06dd89
remove dependee/depender language for now
jdsteve2 May 26, 2020
4755ef7
Merge branch 'master' into lexschedule-and-map-creation
jdsteve2 Jun 1, 2020
2574bec
change identifier prefix for sched checker identifiers from _lp_sched…
jdsteve2 Jun 1, 2020
626140b
rename PairwiseScheduleStatementInstanceSet->StatementInstanceSet
jdsteve2 Jun 1, 2020
132a1c6
rename PairwiseScheduleStatement->StatementRef
jdsteve2 Jun 1, 2020
7a9a5bd
rename StatementInstanceSet.stmt->StatementInstanceSet.stmt_ref
jdsteve2 Jun 1, 2020
30054b1
keep docstring example consistent with identifier naming policy
jdsteve2 Jun 1, 2020
a9bbc92
add example usage to docstring for get_schedule_for_statement_pair() …
jdsteve2 Jun 1, 2020
ed3eb73
add example schedule creation output to docstring examples
jdsteve2 Jun 1, 2020
41716f2
Merge branch 'new-dependency-and-nest-constraint-semantics-developmen…
jdsteve2 Jun 2, 2020
8761fb2
for consistency between runs, sort var names extracted from isl sets
jdsteve2 Jun 2, 2020
055be97
fix docstring indentation
jdsteve2 Jun 2, 2020
6b0b01b
remove redundant usage example and note that a PairwiseScheduleBuilde…
jdsteve2 Jun 2, 2020
bdef0a6
rephrase doc comment about using get_schedule_for_statement_pair to c…
jdsteve2 Jun 2, 2020
6628362
Some styling fixes for pairwise schedule representation
inducer Jun 2, 2020
0bb4444
Placate flake8
inducer Jun 2, 2020
5dafc30
remove get_isl_maps_from_PairwiseScheduleBuilder(); instead get j ina…
jdsteve2 Jun 5, 2020
177f801
resolve merge conflicts
jdsteve2 Jun 5, 2020
bb2ebcf
print name of class in PairwiseScheduleBuilder.__str__()
jdsteve2 Jun 5, 2020
a87f101
rename pose->idx
jdsteve2 Jun 5, 2020
57669bc
change __str__ to __repr__ in StatementInstanceSet() and include clas…
jdsteve2 Jun 5, 2020
e3a4db9
rename _get_isl_map_for_stmt_inst()->_get_map_for_stmt_inst()
jdsteve2 Jun 7, 2020
0e31727
rename create_isl_maps()->build_maps()
jdsteve2 Jun 7, 2020
3e93b62
rename isl_map->map_obj
jdsteve2 Jun 7, 2020
ee4d98f
renamed create_symbolic_isl_map_from_tuples()->create_symbolic_map_fr…
jdsteve2 Jun 8, 2020
6e2becf
remove 'isl' from more locally used var names
jdsteve2 Jun 8, 2020
f528b58
rename _union_of_isl_sets_or_maps()->_get_union()
jdsteve2 Jun 8, 2020
070ca3a
create map_names_match_check() function for checking conditions on is…
jdsteve2 Jun 8, 2020
2f98034
rename align_isl_maps_by_var_names()->ensure_dim_names_match_and_align()
jdsteve2 Jun 8, 2020
c7ce50d
use map_names_match_check() to perform name set match check inside re…
jdsteve2 Jun 8, 2020
d1a7397
rename reorder_dims_by_name()->insert_missing_dims_and_reorder_by_nam…
jdsteve2 Jun 8, 2020
5aa5403
Merge branch 'new-dependency-and-nest-constraint-semantics-developmen…
jdsteve2 Jun 9, 2020
14105e5
add class name to __str__ for StatementRef()
jdsteve2 Jun 12, 2020
6058001
make the integer ids that are used to represent before/after statemen…
jdsteve2 Jun 30, 2020
ffdca11
eliminate 'dom_inames_ordered' args in build_maps()
jdsteve2 Jul 7, 2020
72a91ab
remove class variables statement_var_name and lex_var_prefix from sch…
jdsteve2 Jul 7, 2020
67bbe8b
remove setters for sched checking constants; make __doc__ string; add…
jdsteve2 Jul 10, 2020
b54ed6f
use STATEMENT_VAR_NAME and LEX_VAR_PREFIX constants when building tes…
jdsteve2 Jul 10, 2020
b2c5897
remove StatementRef and change StatementInstanceSet.stmt_ref to just …
jdsteve2 Jul 10, 2020
b4e25dd
rename PairwiseScheduleBuilder.statement_instance_before/after to Pai…
jdsteve2 Jul 10, 2020
bb18e58
remove pad_lex_tuples_with_zeros() method since it's only ever called…
jdsteve2 Jul 13, 2020
2f0c95c
remove get_isl_space() and set_all_isl_space_names(), instead use isl…
jdsteve2 Jul 13, 2020
d8587b0
perform union of maps upon creation in create_symbolic_map_from_tuple…
jdsteve2 Jul 13, 2020
c465bdb
remove utils._get_union()
jdsteve2 Jul 13, 2020
138702b
(commented out code that compares result from isl.affs_from_space() t…
jdsteve2 Jul 13, 2020
6f7e2a3
removed PairwiseScheduleBuilder class; removed PSB methods max_lex_di…
jdsteve2 Jul 14, 2020
87ac1b9
rename test_lexschedule_and_map_creation()->test_lexschedule_creation()
jdsteve2 Jul 14, 2020
f137ba3
Merge branch 'new-dependency-and-nest-constraint-semantics-developmen…
jdsteve2 Jul 14, 2020
2251fa2
remove StatementInstanceSet class, use an ImmutableRecord instead
jdsteve2 Jul 14, 2020
87933ce
fix flake8 error
jdsteve2 Jul 14, 2020
e07b147
assert knl is preprocessed (rather than performing the preprocessing)…
jdsteve2 Jul 19, 2020
17ed282
make lex_points a tuple instead of a list
jdsteve2 Jul 19, 2020
41e8acb
renamed linearization_items_ordered->linearization_items in generate_…
jdsteve2 Jul 19, 2020
bb5128d
when creating schedule, if lp_insn_id is None, assert that the linear…
jdsteve2 Jul 19, 2020
3550e6d
fix indentation on function docstring
jdsteve2 Jul 19, 2020
38d584a
fix pluralizing class in docstring
jdsteve2 Jul 19, 2020
18e4681
assert that ignored linearization items are of specific type
jdsteve2 Jul 20, 2020
1f4edf2
use set().union(*[list comprehension]) instead of loop in list_var_na…
jdsteve2 Jul 20, 2020
7635f47
renamed list_var_names_in_isl_sets()->sorted_union_of_names_in_isl_se…
jdsteve2 Jul 20, 2020
227762f
rename constraint->condition in create_symbolic_map_from_tuples()
jdsteve2 Jul 20, 2020
6d336ba
make function for duplicated code: _conjunction_of_dim_eq_conditions()
jdsteve2 Jul 20, 2020
a81bd48
rename get_concurrent_inames(knl)->partition_inames_by_concurrency(knl)
jdsteve2 Jul 20, 2020
be1cf81
to prevent quadratic complexity in schedule creation, create lex poin…
jdsteve2 Jul 21, 2020
4211f6e
add todo
jdsteve2 Jul 24, 2020
a4e790f
while removing unnecessary dims in maps, also replace int-valued dims…
jdsteve2 Jul 26, 2020
80a89ea
Remove logic avoiding gratuitous incrementing of integer lex dim valu…
jdsteve2 Jul 27, 2020
3dd9327
make generate_pairwise_schedules() return a dictionary mapping (insn_…
jdsteve2 Jul 27, 2020
a4ff29d
minor comment change
jdsteve2 Jul 27, 2020
d44082f
Merge branch 'master' into lexschedule-and-map-creation
jdsteve2 Jul 28, 2020
86c3ff9
When simplifying pairs of lex tuples before map creation, once a dime…
jdsteve2 Aug 3, 2020
39ec3c4
instead of operating on Xbefore and Xafter pairs in pairs of statemen…
jdsteve2 Aug 3, 2020
6bb6989
fix flake8 issue
jdsteve2 Aug 3, 2020
4165485
remove get_islvars_from_space(); instead use isl.affs_from_space()
jdsteve2 Aug 3, 2020
3f4b3b8
make example usage of get_schedules_for_statement_pairs() into a doct…
jdsteve2 Aug 4, 2020
de5ab44
update all docstrings/comments after recent changes
jdsteve2 Aug 4, 2020
5551fd9
remove unused arg (knl) from get_EnterLoop_inames()
jdsteve2 Aug 4, 2020
222b0c7
use list comprehension instead of loop in get_EnterLoop_inames()
jdsteve2 Aug 4, 2020
f1e31d5
temporarily add an assert-false to check for unnecessary functionality
jdsteve2 Aug 4, 2020
8001bd6
handle special case where simplified lex tuples are empty (means stat…
jdsteve2 Aug 4, 2020
567c405
don't add missing dims when aligning domain for intersection in creat…
jdsteve2 Aug 4, 2020
3d321ae
more precise docstring for reorder_dims_by_name()
jdsteve2 Aug 4, 2020
0f18579
make doctest output invalid to see if it fails ci test
jdsteve2 Aug 4, 2020
503247d
undo intentionally incorrect doctest output, also add line break to p…
jdsteve2 Aug 4, 2020
2504e3a
try another approach to handling broken lines in expected doctest res…
jdsteve2 Aug 4, 2020
0d77423
workaround for dumb doctest that can't handle expected output split u…
jdsteve2 Aug 4, 2020
049d17b
Apply 1 suggestion(s) to 1 file(s)
jdsteve2 Aug 28, 2020
15f0855
Apply 1 suggestion(s) to 1 file(s)
jdsteve2 Aug 28, 2020
2f583e5
Apply 1 suggestion(s) to 1 file(s)
jdsteve2 Aug 28, 2020
05d5706
Apply 1 suggestion(s) to 1 file(s)
jdsteve2 Aug 28, 2020
8a882e0
Apply 1 suggestion(s) to 1 file(s)
jdsteve2 Aug 28, 2020
0985a6b
Apply 1 suggestion(s) to 1 file(s)
jdsteve2 Aug 28, 2020
88557ee
Apply 1 suggestion(s) to 1 file(s)
jdsteve2 Aug 28, 2020
5f9d429
Apply 1 suggestion(s) to 1 file(s)
jdsteve2 Aug 28, 2020
0b19941
Apply 1 suggestion(s) to 1 file(s)
jdsteve2 Aug 28, 2020
a6ab09d
change _lp_linchk_statement->_lp_linchk_stmt in doctest after renamin…
jdsteve2 Aug 28, 2020
852ba31
change map_names_match_check->check_that_map_names_match after renami…
jdsteve2 Aug 28, 2020
88f23ea
rephrase docstring for linearization_items argument (the part about a…
jdsteve2 Aug 28, 2020
d72e653
assert that all concurrent EnterLoop inames are tagged Vec or ILP, an…
jdsteve2 Aug 28, 2020
559f778
simplify phrasing of insn_id_pairs arg description (to match phrasing…
jdsteve2 Aug 28, 2020
b992340
move function defs for _pad_tuple_with_zeros() and _simplify_lex_dims…
jdsteve2 Aug 28, 2020
0921a33
remove faulthandler stuff
jdsteve2 Aug 28, 2020
237e7d6
remove redundant lang_version
jdsteve2 Aug 28, 2020
74f9ee4
test_lexschedule_creation(), make kernel instruction/loop order deter…
jdsteve2 Aug 28, 2020
7d34e95
replace call to check_that_map_names_match() with equivalent assertio…
jdsteve2 Sep 2, 2020
6f6d708
make stronger assertion in reorder_dims_by_name (just assert that set…
jdsteve2 Sep 2, 2020
ee4faf0
remove check_that_map_names_match(), replace function call with asser…
jdsteve2 Sep 2, 2020
b8edba9
Apply 1 suggestion(s) to 1 file(s)
inducer Sep 4, 2020
8421640
Merge branch 'lexschedule-and-map-creation' into 'new-dependency-and-…
inducer Sep 4, 2020
b6cdf54
Merge branch 'new-dependency-and-nest-constraint-semantics-developmen…
jdsteve2 Sep 25, 2020
7ca6265
Merge branch 'master' into new-dependency-and-nest-constraint-semanti…
jdsteve2 Sep 29, 2020
4970268
Merge branch 'master' into new-dependency-and-nest-constraint-semanti…
jdsteve2 Nov 10, 2020
4081b9d
Merge branch 'new-dependency-and-nest-constraint-semantics-developmen…
jdsteve2 Jan 25, 2021
fb7ed28
Merge branch 'master' into new-dependency-and-nest-constraint-semanti…
jdsteve2 Feb 23, 2021
fb7b95d
Merge branch 'main' into new-dependency-and-nest-constraint-semantics…
jdsteve2 Mar 28, 2021
edbb093
Merge branch 'main' into new-dependency-and-nest-constraint-semantics…
jdsteve2 Apr 14, 2021
31817a5
Merge branch 'main' into new-dependency-and-nest-constraint-semantics…
jdsteve2 Apr 17, 2021
2b8dd82
Merge branch 'main' into new-dependency-and-nest-constraint-semantics…
jdsteve2 Apr 23, 2021
2ac6415
Merge branch 'main' into new-dependency-and-nest-constraint-semantics…
jdsteve2 Apr 26, 2021
6ffc457
Merge branch 'main' into new-dependency-and-nest-constraint-semantics…
jdsteve2 Apr 27, 2021
74d54c4
Merge branch 'main' into new-dependency-and-nest-constraint-semantics…
jdsteve2 May 23, 2021
637b931
Merge branch 'main' into new-dependency-and-nest-constraint-semantics…
jdsteve2 Jun 6, 2021
0378482
Merge branch 'main' into new-dependency-and-nest-constraint-semantics…
jdsteve2 Jul 14, 2021
20525df
(callables update) call get_one_linearized_kernel on program[knl]
jdsteve2 Jul 14, 2021
bec6dca
change default arg from set to frozenset
jdsteve2 Jul 14, 2021
b98a8de
(callables update) call get_one_linearized_kernel on program[knl] in …
jdsteve2 Jul 14, 2021
b2bcff7
Merge branch 'main' into new-dependency-and-nest-constraint-semantics…
jdsteve2 Jul 23, 2021
b72d964
Merge branch 'main' into new-dependency-and-nest-constraint-semantics…
jdsteve2 Aug 13, 2021
4cf7d96
Merge branch 'main' into new-dependency-and-nest-constraint-semantics…
jdsteve2 Sep 17, 2021
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
2 changes: 2 additions & 0 deletions doc/ref_kernel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ Tag Meaning
Identifiers
-----------

.. _reserved-identifiers:

Reserved Identifiers
^^^^^^^^^^^^^^^^^^^^

Expand Down
144 changes: 144 additions & 0 deletions loopy/schedule/checker/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
__copyright__ = "Copyright (C) 2019 James Stevens"

__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
"""


# {{{ create a pairwise schedules for statement pairs

def get_schedules_for_statement_pairs(
knl,
linearization_items,
insn_id_pairs,
):
r"""For each statement pair in a subset of all statement pairs found in a
linearized kernel, determine the (relative) order in which the statement
instances are executed. For each pair, describe this relative ordering with
a pair of mappings from statement instances to points in a single
lexicographic ordering (a ``pairwise schedule''). When determining the
relative ordering, ignore concurrent inames.

:arg knl: A preprocessed :class:`loopy.kernel.LoopKernel` containing the
linearization items that will be used to create a schedule.

:arg linearization_items: A list of :class:`loopy.schedule.ScheduleItem`
(to be renamed to `loopy.schedule.LinearizationItem`) containing
all linearization items for which pairwise schedules will be
created. To allow usage of this routine during linearization, a
truncated (i.e. partial) linearization may be passed through this
argument.

:arg insn_id_pairs: A list containing pairs of instruction
identifiers.

:returns: A dictionary mapping each two-tuple of instruction identifiers
provided in `insn_id_pairs` to a corresponding two-tuple containing two
:class:`islpy.Map`\ s representing a pairwise schedule as two
mappings from statement instances to lexicographic time, one for
each of the two statements.

.. doctest:

>>> import loopy as lp
>>> import numpy as np
>>> # Make kernel -----------------------------------------------------------
>>> knl = lp.make_kernel(
... "{[i,j,k]: 0<=i<pi and 0<=j<pj and 0<=k<pk}",
... [
... "a[i,j] = j {id=insn_a}",
... "b[i,k] = k+a[i,0] {id=insn_b,dep=insn_a}",
... ])
>>> knl = lp.add_and_infer_dtypes(knl, {"a": np.float32, "b": np.float32})
>>> knl = lp.prioritize_loops(knl, "i,j")
>>> knl = lp.prioritize_loops(knl, "i,k")
>>> # Preprocess
>>> knl = lp.preprocess_kernel(knl)
>>> # Get a linearization
>>> knl = lp.get_one_linearized_kernel(
... knl["loopy_kernel"], knl.callables_table)
>>> # Get a pairwise schedule -----------------------------------------------
>>> from loopy.schedule.checker import get_schedules_for_statement_pairs
>>> # Get two maps ----------------------------------------------------------
>>> schedules = get_schedules_for_statement_pairs(
... knl,
... knl.linearization,
... [("insn_a", "insn_b")],
... )
>>> # Print maps
>>> print("\n".join(
... str(m).replace("{ ", "{\n").replace(" :", "\n:")
... for m in schedules[("insn_a", "insn_b")]
... ))
[pi, pj, pk] -> {
[_lp_linchk_stmt = 0, i, j, k] -> [_lp_linchk_l0 = i, _lp_linchk_l1 = 0]
: 0 <= i < pi and 0 <= j < pj and 0 <= k < pk }
[pi, pj, pk] -> {
[_lp_linchk_stmt = 1, i, j, k] -> [_lp_linchk_l0 = i, _lp_linchk_l1 = 1]
: 0 <= i < pi and 0 <= j < pj and 0 <= k < pk }

"""

# {{{ make sure kernel has been preprocessed

from loopy.kernel import KernelState
assert knl.state in [
KernelState.PREPROCESSED,
KernelState.LINEARIZED]

# }}}

# {{{ Find any EnterLoop inames that are tagged as concurrent
# so that generate_pairwise_schedule() knows to ignore them
# (In the future, this shouldn't be necessary because there
# won't be any inames with ConcurrentTags in EnterLoop linearization items.
# Test which exercises this: test_linearization_checker_with_stroud_bernstein())
from loopy.schedule.checker.utils import (
partition_inames_by_concurrency,
get_EnterLoop_inames,
)
conc_inames, _ = partition_inames_by_concurrency(knl)
enterloop_inames = get_EnterLoop_inames(linearization_items)
conc_loop_inames = conc_inames & enterloop_inames

# The only concurrent EnterLoop inames should be Vec and ILP
from loopy.kernel.data import (VectorizeTag, IlpBaseTag)
for conc_iname in conc_loop_inames:
# Assert that there exists an ilp or vectorize tag (out of the
# potentially multiple other tags on this concurrent iname).
assert any(
isinstance(tag, (VectorizeTag, IlpBaseTag))
for tag in knl.iname_to_tags[conc_iname])

# }}}

# {{{ Create two mappings from {statement instance: lex point}

# include only instructions involved in this dependency
from loopy.schedule.checker.schedule import generate_pairwise_schedules
return generate_pairwise_schedules(
knl,
linearization_items,
insn_id_pairs,
loops_to_ignore=conc_loop_inames,
)

# }}}

# }}}
Loading