Skip to content

Commit

Permalink
#190 Remove unecessary arguments from Arguments.append
Browse files Browse the repository at this point in the history
  • Loading branch information
sergisiso committed Dec 19, 2019
1 parent 9eda986 commit 5816229
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 17 deletions.
12 changes: 4 additions & 8 deletions src/psyclone/gocean1p0.py
Original file line number Diff line number Diff line change
Expand Up @@ -1462,19 +1462,15 @@ def scalars(self):
args = args_filter(self._args, arg_types=["scalar"])
return [arg.name for arg in args]

def append(self, argtype, name, access):
''' Append generic (non-api-specific) KernelArguments to the Argument
list.
def append(self, name):
''' Append a GOKernelArgument to the Argument list.
:param str argtype: specifies the appended Arg type.
:param str name: name of the appended argument.
:param access: specifies the appended Arg access.
:type access: :py:class:`psyclone.core.access_type.AccessType`
'''
from psyclone.parse.algorithm import Arg
from psyclone.parse.kernel import Descriptor
descriptor = Descriptor(access, "")
arg = Arg(argtype, name, name)
descriptor = Descriptor(None, "") # Create a dummy descriptor
arg = Arg("variable", name, name)
argument = GOKernelArgument(descriptor, arg, self._parent_call)
self.args.append(argument)

Expand Down
5 changes: 1 addition & 4 deletions src/psyclone/psyGen.py
Original file line number Diff line number Diff line change
Expand Up @@ -4674,14 +4674,11 @@ def scalars(self):
raise NotImplementedError(
"Arguments.scalars must be implemented in sub-class")

def append(self, argtype, name, access):
def append(self, name):
''' Abstract method to append KernelArguments to the Argument
list.
:param str argtype: specifies the appended Arg type.
:param str name: name of the appended argument.
:param access: specifies the appended Arg access.
:type access: :py:class:`psyclone.core.access_type.AccessType`
'''
raise NotImplementedError(
"Arguments.append must be implemented in sub-class")
Expand Down
2 changes: 1 addition & 1 deletion src/psyclone/tests/psyGen_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ def test_arguments_abstract():
assert ("Arguments.raw_arg_list must be implemented in sub-class"
in str(err.value))
with pytest.raises(NotImplementedError) as err:
_ = my_arguments.append(None, None, None)
_ = my_arguments.append("var")
assert ("Arguments.append must be implemented in sub-class"
in str(err.value))

Expand Down
6 changes: 2 additions & 4 deletions src/psyclone/transformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3879,7 +3879,5 @@ def apply(self, node, options=None):
current_arg_list.append(globalvar)
symtab.specify_argument_list(current_arg_list)

# Add the Global variable in the call argument list
from psyclone.core.access_type import AccessType
node.arguments.append("variable", globalvar.name,
AccessType.READWRITE)
# Add the global variable in the call argument list
node.arguments.append(globalvar.name)

0 comments on commit 5816229

Please sign in to comment.