Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable support for data-dependent if-else #76

Open
agent-lee opened this issue Dec 10, 2020 · 1 comment
Open

Enable support for data-dependent if-else #76

agent-lee opened this issue Dec 10, 2020 · 1 comment
Labels
high priority missing Expected feature missing (i.e., compiler support lacking)

Comments

@agent-lee
Copy link
Collaborator

Needed for catching corner cases regarding pathological values.

Repro specification:

  float acc = 0.0f;
  for (int i = 0; i < 4; i++) {
    acc += a_in[i] * a_in[i];
  }
  for (int i = 0; i < 4; i++) {
    if (acc == 0.0f) {
      b_out[i] = 0.0f;
    } else {
      b_out[i] = a_in[i] / acc;
    }
  }
}```

Compilation aborts with:

Writing intermediate files to: compile-out
==: this match expander must be used inside match
in: (== acc 0.0)
context...:
do-raise-syntax-error
apply-transformer-in-context
apply-transformer52
dispatch-transformer41
for-loop
[repeats 1 more time]
finish-bodys
for-loop
finish-bodys
for-loop
[repeats 1 more time]
finish-bodys
for-loop
[repeats 1 more time]
finish-bodys
for-loop
...
Error: Compilation aborted. cdios return error code 1.

@agent-lee agent-lee added the missing Expected feature missing (i.e., compiler support lacking) label Dec 10, 2020
@avanhatt avanhatt changed the title Enable support for if-else Enable support for data-dependent if-else Jan 27, 2021
@avanhatt
Copy link
Contributor

The example kernel here is data-dependent, so support will probably involve modifying the rewrite engine and backend in addition to the c frontend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high priority missing Expected feature missing (i.e., compiler support lacking)
Projects
None yet
Development

No branches or pull requests

2 participants