diff --git a/pystencils/cpu/vectorization.py b/pystencils/cpu/vectorization.py index 2b9cb5685c7d744d7cb2e915afa7803f019ba7bc..e4b9f807bdffc280d65a934310904d6de367986c 100644 --- a/pystencils/cpu/vectorization.py +++ b/pystencils/cpu/vectorization.py @@ -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, with the purpose of declaring certain scalar constants entering the kernel from outside 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 - of loops. They have to be adapted with a castFunc to the vector datatype. + 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. """ if instruction_set == 'best': if get_supported_instruction_sets(): @@ -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] 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): - # no vector type in expr: dont scalar expression to vec + # no vector type in expr: don't cast scalar expression to vec return expr else: 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 = [ 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)] diff --git a/pystencils/transformations.py b/pystencils/transformations.py index d3d41fe34d0bc508020fed1cc09358c7d24d9f88..b51f0bee7c158171242b8d9fe0242f1ca4dc7827 100644 --- a/pystencils/transformations.py +++ b/pystencils/transformations.py @@ -633,7 +633,7 @@ def move_constants_before_loop(ast_node, rename_moved_consts = False): block.append(child) 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) continue