Reference Guide
2.5.0
|
Public Member Functions | |
def | __init__ (self, nowait=False) |
def | __str__ (self) |
def | omp_nowait (self) |
def | name (self) |
def | omp_nowait (self, value) |
def | apply (self, node_list, options=None) |
Public Member Functions inherited from psyclone.transformations.ParallelRegionTrans | |
def | __init__ (self) |
def | validate (self, node_list, options=None) |
Public Member Functions inherited from psyclone.psyir.transformations.region_trans.RegionTrans | |
def | get_node_list (self, nodes) |
Public Attributes | |
omp_nowait | |
Static Public Attributes | |
tuple | excluded_node_types |
Static Public Attributes inherited from psyclone.transformations.ParallelRegionTrans | |
tuple | excluded_node_types = (CodeBlock, Return, psyGen.HaloExchange) |
Static Public Attributes inherited from psyclone.psyir.transformations.region_trans.RegionTrans | |
tuple | excluded_node_types = () |
Create an OpenMP SINGLE region by inserting directives. The most likely use case for this transformation is to wrap around task-based transformations. The parent region for this should usually also be a OMPParallelTrans. :param bool nowait: whether to apply a nowait clause to this \ transformation. The default value is False For example: >>> from psyclone.parse.algorithm import parse >>> from psyclone.psyGen import PSyFactory >>> api = "gocean1.0" >>> ast, invokeInfo = parse(GOCEAN_SOURCE_FILE, api=api) >>> psy = PSyFactory(api).create(invokeInfo) >>> >>> from psyclone.transformations import OMPParallelTrans, OMPSingleTrans >>> singletrans = OMPSingleTrans() >>> paralleltrans = OMPParallelTrans() >>> >>> schedule = psy.invokes.get('invoke_0').schedule >>> # Uncomment the following line to see a text view of the schedule >>> # print(schedule.view()) >>> >>> # Enclose all of these loops within a single OpenMP >>> # SINGLE region >>> singletrans.apply(schedule.children) >>> # Enclose all of these loops within a single OpenMP >>> # PARALLEL region >>> paralleltrans.apply(schedule.children) >>> # Uncomment the following line to see a text view of the schedule >>> # print(schedule.view())
Definition at line 1277 of file transformations.py.
def psyclone.transformations.OMPSingleTrans.apply | ( | self, | |
node_list, | |||
options = None |
|||
) |
Apply the OMPSingleTrans transformation to the specified node in a Schedule. At code-generation time this node must be within (i.e. a child of) an OpenMP PARALLEL region. Code generation happens when :py:meth:`OMPLoopDirective.gen_code` is called, or when the PSyIR tree is given to a backend. If the keyword "nowait" is specified in the options, it will cause a nowait clause to be added if it is set to True, otherwise no clause will be added. :param node_list: the supplied node or node list to which we will \ apply the OMPSingleTrans transformation :type node_list: (a list of) :py:class:`psyclone.psyir.nodes.Node` :param options: a list with options for transformations \ and validation. :type options: Optional[Dict[str, Any]] :param bool options["nowait"]: indicating whether or not to use a nowait clause on this \ single region.
Reimplemented from psyclone.transformations.ParallelRegionTrans.
Definition at line 1378 of file transformations.py.
References psyclone.transformations.OMPSingleTrans.omp_nowait.
def psyclone.transformations.OMPSingleTrans.name | ( | self | ) |
:returns: the name of this transformation. :rtype: str
Reimplemented from psyclone.psyGen.Transformation.
Definition at line 1337 of file transformations.py.
def psyclone.transformations.OMPSingleTrans.omp_nowait | ( | self | ) |
:returns: whether or not this Single region uses a nowait \ clause to remove the end barrier. :rtype: bool
Definition at line 1329 of file transformations.py.
References psyclone.transformations.OMPSingleTrans._omp_nowait.
def psyclone.transformations.OMPSingleTrans.omp_nowait | ( | self, | |
value | |||
) |
Sets the nowait property that will be specified by this transformation. Checks that the value supplied in :py:obj:`value` is a bool :param bool value: whether this Single clause should have a \ nowait applied. :raises TypeError: if the value parameter is not a bool.
Definition at line 1345 of file transformations.py.
References psyclone.transformations.OMPSingleTrans._omp_nowait, and psyclone.transformations.OMPSingleTrans.omp_nowait.
|
static |
Definition at line 1314 of file transformations.py.