Commit fe314070 authored by Frederik Hennig's avatar Frederik Hennig
Browse files

Reverted unnecessary changes, added doc comment

parent 9eabc9b6
Pipeline #32514 failed with stage
in 32 minutes and 54 seconds
......@@ -18,7 +18,7 @@ AssignmentOrAstNodeList = List[Union[Assignment, ast.Node]]
def create_kernel(assignments: AssignmentOrAstNodeList, function_name: str = "kernel", type_info='double',
split_groups=(), iteration_slice=None, ghost_layers=None,
skip_independence_check=False, loop_step=1, allow_double_writes=False) -> KernelFunction:
skip_independence_check=False, allow_double_writes=False) -> KernelFunction:
"""Creates an abstract syntax tree for a kernel function, by taking a list of update rules.
Loops are created according to the field accesses in the equations.
......@@ -39,6 +39,9 @@ def create_kernel(assignments: AssignmentOrAstNodeList, function_name: str = "ke
all dimensions
skip_independence_check: don't check that loop iterations are independent. This is needed e.g. for
periodicity kernel, that access the field outside the iteration bounds. Use with care!
allow_double_writes: If True, don't check if every field is only written at a single location. This is required
for example for kernels that are compiled with loop step sizes > 1, that handle multiple cells
at once. Use with care!
AST node representing a function, that can be printed as C or CUDA code
......@@ -150,7 +150,7 @@ def get_common_shape(field_set):
return shape
def make_loop_over_domain(body, iteration_slice=None, ghost_layers=None, loop_order=None, loop_step=1):
def make_loop_over_domain(body, iteration_slice=None, ghost_layers=None, loop_order=None):
"""Uses :class:`pystencils.field.Field.Access` to create (multiple) loops around given AST.
......@@ -195,7 +195,7 @@ def make_loop_over_domain(body, iteration_slice=None, ghost_layers=None, loop_or
if iteration_slice is None:
begin = ghost_layers[loop_coordinate][0]
end = shape[loop_coordinate] - ghost_layers[loop_coordinate][1]
new_loop = ast.LoopOverCoordinate(current_body, loop_coordinate, begin, end, step=loop_step)
new_loop = ast.LoopOverCoordinate(current_body, loop_coordinate, begin, end)
current_body = ast.Block([new_loop])
slice_component = iteration_slice[loop_coordinate]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment