Skip to content
Snippets Groups Projects
Commit d2dfecbf authored by Daniel Bauer's avatar Daniel Bauer :speech_balloon:
Browse files

fix typos

parent 6904b818
Branches
No related tags found
No related merge requests found
...@@ -103,8 +103,8 @@ def vectorize(kernel_ast: ast.KernelFunction, instruction_set: str = 'best', ...@@ -103,8 +103,8 @@ def vectorize(kernel_ast: ast.KernelFunction, instruction_set: str = 'best',
vectorized_loop_substitutions: a dictionary of symbols and substitutions to be applied only to the vectorized loop, vectorized_loop_substitutions: a dictionary of symbols and substitutions to be applied only to the vectorized loop,
with the purpose of declaring certain scalar constants entering the kernel from outside with the purpose of declaring certain scalar constants entering the kernel from outside
as vectorized variables in front of the loop. as vectorized variables in front of the loop.
moved_nodes: enables cooperation with moved constants: a set of TypedSybol of symbols that were previously moved out moved_nodes: enables cooperation with moved constants: a set of TypedSymbol of symbols that were previously moved out
of loops. They have to be adapted with a castFunc to the vector datatype. of loops. They have to be adapted with a CastFunc to the vector datatype.
""" """
if instruction_set == 'best': if instruction_set == 'best':
if get_supported_instruction_sets(): if get_supported_instruction_sets():
...@@ -302,11 +302,11 @@ def insert_vector_casts(ast_node, instruction_set, default_float_type='double', ...@@ -302,11 +302,11 @@ def insert_vector_casts(ast_node, instruction_set, default_float_type='double',
new_args = [visit_expr(a, default_type) for a in expr.args] new_args = [visit_expr(a, default_type) for a in expr.args]
arg_types = [get_type_of_expression(a, default_float_type=default_type) for a in new_args] arg_types = [get_type_of_expression(a, default_float_type=default_type) for a in new_args]
if not any(type(t) is VectorType for t in arg_types): if not any(type(t) is VectorType for t in arg_types):
# no vector type in expr: dont scalar expression to vec # no vector type in expr: don't cast scalar expression to vec
return expr return expr
else: else:
target_type = collate_types(arg_types) target_type = collate_types(arg_types)
# insert cast function to target type (e.g. vectorType) if its missing # insert cast function to target type (e.g. vectorType) if it's missing
casted_args = [ casted_args = [
CastFunc(a, target_type) if t != target_type and not isinstance(a, VectorMemoryAccess) and not all(isinstance(f, TypedSymbol) for f in a.free_symbols) else a CastFunc(a, target_type) if t != target_type and not isinstance(a, VectorMemoryAccess) and not all(isinstance(f, TypedSymbol) for f in a.free_symbols) else a
for a, t in zip(new_args, arg_types)] for a, t in zip(new_args, arg_types)]
......
...@@ -633,7 +633,7 @@ def move_constants_before_loop(ast_node, rename_moved_consts = False): ...@@ -633,7 +633,7 @@ def move_constants_before_loop(ast_node, rename_moved_consts = False):
block.append(child) block.append(child)
continue continue
if isinstance(child, ast.SympyAssignment) and isinstance(child.lhs, ResolvedFieldAccess): # dont move field accesses if isinstance(child, ast.SympyAssignment) and isinstance(child.lhs, ResolvedFieldAccess): # don't move field accesses
block.append(child) block.append(child)
continue continue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment