Skip to content
Snippets Groups Projects
Commit aa0434b6 authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Reenable domain check in multi-domain.

parent 7955a50d
No related branches found
No related tags found
No related merge requests found
......@@ -46,9 +46,6 @@ To-do
- Group instructions by dependency/inames for scheduling, to
increase sched. scalability
- Multi-domain
- Reenable codegen sanity check.
- Kernel splitting (via what variables get computed in a kernel)
- What if no universally valid precompute base index expression is found?
......@@ -56,8 +53,6 @@ To-do
- Add dependencies after the fact
- Expose iname-duplicate-and-rename as a primitive.
- Fix all tests
- Scalar insn priority
......@@ -71,6 +66,8 @@ To-do
Future ideas
^^^^^^^^^^^^
- Expose iname-duplicate-and-rename as a primitive.
- Array language
- reg rolling
......@@ -121,7 +118,9 @@ Dealt with
- What to do about constants in codegen? (...f suffix, complex types)
-> dealt with by type contexts
- relating to Multi-Domain
- relating to Multi-Domain [DONE]
- Reenable codegen sanity check. [DONE]
- Incorporate loop-bound-mediated iname dependencies into domain
parenthood. [DONE]
......
......@@ -209,12 +209,7 @@ def run_automatic_checks(kernel):
def check_implemented_domains(kernel, implemented_domains):
from islpy import dim_type
parameter_inames = set(
kernel.domain.get_dim_name(dim_type.param, i)
for i in range(kernel.domain.dim(dim_type.param)))
from islpy import align_spaces
assumptions = align_spaces(kernel.assumptions, kernel.domain)
from islpy import align_spaces, align_two
for insn_id, idomains in implemented_domains.iteritems():
insn = kernel.id_to_insn[insn_id]
......@@ -224,17 +219,34 @@ def check_implemented_domains(kernel, implemented_domains):
insn_impl_domain = idomains[0]
for idomain in idomains[1:]:
insn_impl_domain = insn_impl_domain | idomain
assumptions = align_spaces(kernel.assumptions, insn_impl_domain,
obj_bigger_ok=True)
insn_impl_domain = (
(insn_impl_domain & assumptions)
.project_out_except(kernel.insn_inames(insn), [dim_type.set]))
desired_domain = ((kernel.domain & assumptions)
insn_inames = kernel.insn_inames(insn)
insn_domain = kernel.get_inames_domain(insn_inames)
assumptions = align_spaces(kernel.assumptions, insn_domain,
obj_bigger_ok=True)
desired_domain = ((insn_domain & assumptions)
.project_out_except(kernel.insn_inames(insn), [dim_type.set]))
insn_impl_domain, desired_domain = align_two(
insn_impl_domain, desired_domain)
print insn_impl_domain
print desired_domain
print insn_impl_domain != desired_domain
if insn_impl_domain != desired_domain:
i_minus_d = insn_impl_domain - desired_domain
d_minus_i = desired_domain - insn_impl_domain
parameter_inames = set(
insn_domain.get_dim_name(dim_type.param, i)
for i in range(kernel.domain.dim(dim_type.param)))
lines = []
for kind, diff_set in [
("implemented, but not desired", i_minus_d),
......
......@@ -331,8 +331,8 @@ def generate_code(kernel, with_annotation=False,
)
"""))
#from loopy.check import check_implemented_domains
#assert check_implemented_domains(kernel, gen_code.implemented_domains)
from loopy.check import check_implemented_domains
assert check_implemented_domains(kernel, gen_code.implemented_domains)
# {{{ handle preambles
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment