Confusing usage of transformations

Open
#978 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
compilers

Research direction

Start by reading the existing TransInfo object in psyclone/core/trans_nfo.py and compare the transformations under psyir/transformation with those under domain/API/transformations. Determine how an optional API context should select generic versus API-specific transformations, then verify that the proposed get("extract") and get("profile") usage works in relevant tests.

Written by the indexing model from the issue text.

Description

enhancement

It is quite annoying (imho even for a more experienced dev) to keep track of which transformation to use: profile_transform comes from psyir/transformation (independent of API), while kernel extraction comes from domain/API/transformations (API dependent).

I know that TransInfo kept track of transformation in the past (and which afaik is broken atm since we started to move transforms to psyir/transformations), but it still needs the user to know if a generic transformation or an API-specific transformation is to be used.

My suggestion: update this global object that stores transformation to handle API-specific transformation ... something like (I never liked that it came from psygen):

from psyclone.core.trans_nfo import TransInfo

all_trans = TransInfo()                # (1)
extract = all_trans.get("extract")     # would pick API-specific transform
profile = all_trans.get("profile")     # choses the generic API

In (1) we could supply the API as optional argument (but except maybe in tests the config object knows which API the user is working with).

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.