devito.dle package

Submodules

devito.dle.blocking_utils module

devito.dle.blocking_utils.fold_blockable_tree(node, exclude_innermost=False)[source]

Create IterationFold`s from sequences of nested :class:`Iteration.

devito.dle.blocking_utils.unfold_blocked_tree(node)[source]

Unfold nested IterationFold.

Example:

Given a section of Iteration/Expression tree as below:

for i = 1 to N-1  // folded
  for j = 1 to N-1  // folded
    foo1()

Assuming a fold with offset 1 in both /i/ and /j/ and body foo2(), create:

for i = 1 to N-1
  for j = 1 to N-1
    foo1()
for i = 2 to N-2
  for j = 2 to N-2
    foo2()

devito.dle.transformer module

devito.dle.transformer.init_dle(backend_modes)[source]
devito.dle.transformer.transform(node, mode='basic', options=None)[source]

Transform Iteration/Expression trees to generate highly optimized C code.

Parameters:
  • node – The Iteration/Expression tree to be transformed, or an iterable of Iteration/Expression trees.
  • mode – Drive the tree transformation. mode is a string indicating a certain optimization pipeline.
  • options – A dictionary with additional information to drive the DLE.

The mode parameter accepts the following values:

* 'noop': Do nothing.
* 'basic': Add instructions to avoid denormal numbers and create elemental
           functions for rapid JIT-compilation.
* 'advanced': 'basic', vectorization, loop blocking.
* 'speculative': Apply all of the 'advanced' transformations, plus other
                 transformations that might increase (or possibly decrease)
                 performance.

The options parameter accepts the following values:

* 'blockshape': The block shape for loop blocking (a tuple).
* 'blockinner': By default, loop blocking is not applied to the innermost
                dimension of an Iteration/Expression tree (to maximize
                vectorization). Set this flag to True to override this
                heuristic.
* 'blockalways': Apply blocking even though the DLE thinks it's not
                 worthwhile applying it.

Module contents