Skip to content
Snippets Groups Projects
Commit 03675133 authored by Dominic Kempf's avatar Dominic Kempf
Browse files

Cleanup

parent 68b39fe0
No related branches found
No related tags found
No related merge requests found
""" Export the interface interesting to the rest of the project """
from dune.perftool.loopy.transformations.collect_precompute import collect_vector_data_precompute
from dune.perftool.loopy.transformations.duplicate import heuristic_duplication
""" A kernel transformation that collects data until the vector size is reached """ """ A kernel transformation that precomputes data and then splits computation
in chunks of vector size independent of divisibility of the loop bounds. """
from dune.perftool.loopy.vcl import get_vcl_type_size from dune.perftool.loopy.vcl import get_vcl_type_size
from dune.perftool.loopy.vectorview import (add_vector_view, from dune.perftool.loopy.transformations.vectorview import (add_vector_view,
get_vector_view_name, get_vector_view_name,
) )
from dune.perftool.tools import get_pymbolic_basename from dune.perftool.tools import get_pymbolic_basename
from loopy.kernel.creation import parse_domains from loopy.kernel.creation import parse_domains
...@@ -17,7 +18,7 @@ import loopy as lp ...@@ -17,7 +18,7 @@ import loopy as lp
import numpy as np import numpy as np
def collect_vector_data(knl, insns, inames): def collect_vector_data_precompute(knl, insns, inames):
# #
# Process/Assert/Standardize the input # Process/Assert/Standardize the input
# #
...@@ -55,12 +56,9 @@ def collect_vector_data(knl, insns, inames): ...@@ -55,12 +56,9 @@ def collect_vector_data(knl, insns, inames):
# Do precomputation of the quantity # Do precomputation of the quantity
prec_quantity = "{}_precomputed".format(quantity) prec_quantity = "{}_precomputed".format(quantity)
compute_id = "{}_compute_id".format(quantity)
compute_ids.append(compute_id)
knl = lp.precompute(knl, subst_name, inames, knl = lp.precompute(knl, subst_name, inames,
temporary_name=prec_quantity, temporary_name=prec_quantity,
compute_insn_id=compute_id) )
# Introduce a vector view of the precomputation result # Introduce a vector view of the precomputation result
knl = add_vector_view(knl, prec_quantity) knl = add_vector_view(knl, prec_quantity)
......
...@@ -501,13 +501,13 @@ def generate_kernel(integrals): ...@@ -501,13 +501,13 @@ def generate_kernel(integrals):
from loopy import make_reduction_inames_unique from loopy import make_reduction_inames_unique
kernel = make_reduction_inames_unique(kernel) kernel = make_reduction_inames_unique(kernel)
kernel = preprocess_kernel(kernel)
# Apply the transformations that were gathered during tree traversals # Apply the transformations that were gathered during tree traversals
for trafo in transformations: for trafo in transformations:
kernel = trafo[0](kernel, *trafo[1]) kernel = trafo[0](kernel, *trafo[1])
kernel = preprocess_kernel(kernel) from dune.perftool.loopy import heuristic_duplication
from dune.perftool.loopy.duplicate import heuristic_duplication
kernel = heuristic_duplication(kernel) kernel = heuristic_duplication(kernel)
# Now add the preambles to the kernel # Now add the preambles to the kernel
......
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