psyclone.domain.gocean.transformations.gocean_loop_fuse_trans
This module contains the GOcean-specific loop-fusion transformation.
Classes
GOceanLoopFuseTrans
: GOcean API specialisation of thebase class
- class psyclone.domain.gocean.transformations.gocean_loop_fuse_trans.GOceanLoopFuseTrans
GOcean API specialisation of the
base class
in order to fuse two GOcean loops after performing validity checks (e.g. that the loops are over the same grid-point type). For example:>>> from psyclone.parse.algorithm import parse >>> from psyclone.psyGen import PSyFactory >>> ast, invokeInfo = parse("shallow_alg.f90") >>> psy = PSyFactory("gocean1.0").create(invokeInfo) >>> schedule = psy.invokes.get('invoke_0').schedule >>> print(schedule.view()) >>> >>> from psyclone.transformations import GOceanLoopFuseTrans >>> ftrans = GOceanLoopFuseTrans() >>> ftrans.apply(schedule[0], schedule[1]) >>> print(schedule.view())
Inheritance
- validate(node1, node2, options=None)
Checks if it is valid to apply the GOceanLoopFuseTrans transform. It ensures that the fused loops are over the same grid-point types, before calling the normal LoopFuseTrans validation function.
- Parameters:
node1 (
psyclone.gocean1p0.GOLoop
) – the first Node representing a GOLoop.node2 (
psyclone.gocean1p0.GOLoop
) – the second Node representing a GOLoop.options (Optional[Dict[str, Any]]) – a dictionary with options for transformations.
- Raises:
TransformationError – if the supplied loops are over different grid-point types.
TransformationError – if invalid parameters are passed in.