[Gocean] The gen_ocl doesn't handle duplicate variable names

Open
#798 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
compilers

Research direction

Start by examining the gen_ocl and set_args methods in the OpenCL generation path, then reproduce the duplicate-name case from src/psyclone/tests/test_files/gocean1p0/driver_test.f90. The issue points toward a future gen()->PSyIR->back-end design; done would require duplicate variable names to be detected or handled without relying on a compiler error.

Written by the indexing model from the issue text.

Description

Most of the gen_ocl and set_args method uses variables strings instead of PSyIR symbols and therefore doesn't check if a name has already been used. This is a problem in examples like src/psyclone/tests/test_files/gocean1p0/driver_test.f90 where one of the passed arguments is purposely named as a grid_property variable name.

Since this doesn't happen in any of the main codes that target OpenCL and the compiler already gives a readable error this won't be fixed for now.

In the future we may go to a generation with gen()->PSyIR->back-end , which will potentially solve this problem.

Dominant language
Python
Stars
137
Forks
36
Avg merge
6d 16h
Merged PRs (30d)
18

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stfc/PSyclone

All issues in stfc/PSyclone

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.