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

PEP8 loopy.kernel.tools.

parent bd84ce7b
No related branches found
No related tags found
No related merge requests found
...@@ -25,14 +25,10 @@ THE SOFTWARE. ...@@ -25,14 +25,10 @@ THE SOFTWARE.
""" """
import numpy as np import numpy as np
from islpy import dim_type from islpy import dim_type
# {{{ add and infer argument dtypes # {{{ add and infer argument dtypes
def add_argument_dtypes(knl, dtype_dict): def add_argument_dtypes(knl, dtype_dict):
...@@ -65,10 +61,12 @@ def add_argument_dtypes(knl, dtype_dict): ...@@ -65,10 +61,12 @@ def add_argument_dtypes(knl, dtype_dict):
return knl.copy(args=new_args) return knl.copy(args=new_args)
def get_arguments_with_incomplete_dtype(knl): def get_arguments_with_incomplete_dtype(knl):
return [arg.name for arg in knl.args return [arg.name for arg in knl.args
if arg.dtype is None] if arg.dtype is None]
def add_and_infer_argument_dtypes(knl, dtype_dict): def add_and_infer_argument_dtypes(knl, dtype_dict):
knl = add_argument_dtypes(knl, dtype_dict) knl = add_argument_dtypes(knl, dtype_dict)
...@@ -77,6 +75,7 @@ def add_and_infer_argument_dtypes(knl, dtype_dict): ...@@ -77,6 +75,7 @@ def add_and_infer_argument_dtypes(knl, dtype_dict):
# }}} # }}}
# {{{ find_all_insn_inames fixed point iteration # {{{ find_all_insn_inames fixed point iteration
def find_all_insn_inames(kernel): def find_all_insn_inames(kernel):
...@@ -181,6 +180,7 @@ def find_all_insn_inames(kernel): ...@@ -181,6 +180,7 @@ def find_all_insn_inames(kernel):
# }}} # }}}
# {{{ set operation cache # {{{ set operation cache
class SetOperationCacheManager: class SetOperationCacheManager:
...@@ -192,7 +192,7 @@ class SetOperationCacheManager: ...@@ -192,7 +192,7 @@ class SetOperationCacheManager:
hashval = hash(set) hashval = hash(set)
bucket = self.cache.setdefault(hashval, []) bucket = self.cache.setdefault(hashval, [])
for bkt_set, bkt_op, bkt_args, result in bucket: for bkt_set, bkt_op, bkt_args, result in bucket:
if set.plain_is_equal(bkt_set) and op == bkt_op and args == bkt_args: if set.plain_is_equal(bkt_set) and op == bkt_op and args == bkt_args:
return result return result
...@@ -233,6 +233,7 @@ class SetOperationCacheManager: ...@@ -233,6 +233,7 @@ class SetOperationCacheManager:
# }}} # }}}
# {{{ domain change helper # {{{ domain change helper
class DomainChanger: class DomainChanger:
...@@ -268,6 +269,7 @@ class DomainChanger: ...@@ -268,6 +269,7 @@ class DomainChanger:
# }}} # }}}
# {{{ graphviz / dot export # {{{ graphviz / dot export
def get_dot_dependency_graph(kernel, iname_cluster=False, iname_edge=True): def get_dot_dependency_graph(kernel, iname_cluster=False, iname_edge=True):
...@@ -291,6 +293,7 @@ def get_dot_dependency_graph(kernel, iname_cluster=False, iname_edge=True): ...@@ -291,6 +293,7 @@ def get_dot_dependency_graph(kernel, iname_cluster=False, iname_edge=True):
# }}} # }}}
# {{{ domain parameter finder # {{{ domain parameter finder
class DomainParameterFinder: class DomainParameterFinder:
...@@ -323,8 +326,8 @@ class DomainParameterFinder: ...@@ -323,8 +326,8 @@ class DomainParameterFinder:
try: try:
# friggin' overkill :) # friggin' overkill :)
param_expr = solve_affine_equations_for( param_expr = solve_affine_equations_for(
[dep.name], [(shape_i, var("shape_i"))]) \ [dep.name], [(shape_i, var("shape_i"))]
[dep.name] )[dep.name]
except: except:
# went wrong? oh well # went wrong? oh well
pass pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment