Skip to content

[Issue]: Precomputed Condiction Error #230

@ruanjm

Description

@ruanjm

Problem Description

Error in flyc.kernel:

Pass:

# Inline Compare — AST rewriter generates scf.IfOp correctl
if tid < threshold:
    buffer_ops.buffer_store(arith.constant(1), rsrc, tid)

Fail:

# Store result in a variable first.
# Bug: ``flag`` is an ast.Name node; _could_be_dynamic returns Fal
# so the ``if`` stays as Python-level and always evaluates True.
flag = tid < threshold
if flag:
    buffer_ops.buffer_store(arith.constant(1), rsrc, tid)

Operating System

all

CPU

all

GPU

all

ROCm Version

all

ROCm Component

No response

Steps to Reproduce

  1. Check out to jruan/test_precomp_cond
  2. Run python tests/python/examples/test_if_precomputed_condition.py

(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support

No response

Additional Information

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions