|
def | create (call, parent=None) |
|
A GOcean-specific kernel-call factory. A standard kernel call in
GOcean consists of a doubly-nested loop (over i and j) and a call to
the user-supplied kernel routine.
Definition at line 1021 of file gocean1p0.py.
◆ create()
def psyclone.gocean1p0.GOKernCallFactory.create |
( |
|
call, |
|
|
|
parent = None |
|
) |
| |
|
static |
Create a new instance of a call to a GO kernel. Includes the
looping structure as well as the call to the kernel itself.
:param parent: node where the kernel call structure will be inserted.
:type parent: :py:class:`psyclone.psyir.nodes.Node`
:returns: new PSyIR tree representing the kernel call loop.
:rtype: :py:class:`psyclone.gocean1p0.GOLoop`
Definition at line 1026 of file gocean1p0.py.
1026 def create(call, parent=None):
1027 ''' Create a new instance of a call to a GO kernel. Includes the
1028 looping structure as well as the call to the kernel itself.
1030 :param parent: node where the kernel call structure will be inserted.
1031 :type parent: :py:class:`psyclone.psyir.nodes.Node`
1033 :returns: new PSyIR tree representing the kernel call loop.
1034 :rtype: :py:class:`psyclone.gocean1p0.GOLoop`
1042 gocall = GOKern(call, parent=parent)
1045 iteration_space = gocall.iterates_over
1046 field_space = gocall.arguments.iteration_space_arg().function_space
1047 field_name = gocall.arguments.iteration_space_arg().name
1048 index_offset = gocall.index_offset
1051 outer_loop = GOLoop.create(loop_type=
"outer",
1052 iteration_space=iteration_space,
1053 field_space=field_space,
1054 field_name=field_name,
1055 index_offset=index_offset,
1057 inner_loop = GOLoop.create(loop_type=
"inner",
1058 iteration_space=iteration_space,
1059 field_space=field_space,
1060 field_name=field_name,
1061 index_offset=index_offset,
1062 parent=outer_loop.loop_body)
1063 outer_loop.loop_body.addchild(inner_loop)
1066 gocall._parent =
None
1067 inner_loop.loop_body.addchild(gocall)
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/psyclone-ref/checkouts/latest/src/psyclone/gocean1p0.py