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

Support hcl.assert_ in SHLS backend #458

Closed
zzzDavid opened this issue May 3, 2022 · 0 comments
Closed

Support hcl.assert_ in SHLS backend #458

zzzDavid opened this issue May 3, 2022 · 0 comments
Assignees
Labels

Comments

@zzzDavid
Copy link
Collaborator

zzzDavid commented May 3, 2022

Description

hcl.assert_ raises an exception for the StratusHLS backend:

heterocl.tvm._ffi.base.TVMError: [15:49:14] include/tvm/ir_functor_ext.h:262: Do not have a default for Assert

Example

def test1():
    # generates: assert ((uint32)0 < uint32(A[0]));
    # the second uint32 is oddly specified ...
    def func(A):
        hcl.assert_(A[0] > 0, "")

    A = hcl.placeholder((2,), "A", dtype=hcl.UInt(16))
    s = hcl.create_schedule([A], func)

    m = hcl.build(s, "shls")
@zzzDavid zzzDavid self-assigned this May 3, 2022
@zzzDavid zzzDavid added the bug label May 3, 2022
zzzDavid added a commit to zzzDavid/heterocl that referenced this issue May 3, 2022
zzzDavid added a commit to zzzDavid/heterocl that referenced this issue May 3, 2022
hecmay pushed a commit that referenced this issue May 4, 2022
* [Fix] Add test case for #458

* [Fix] Add Assert stmt visitor in code analysis pass

* [Fix] Fix assert stmt in SHLS

* [Fix] Add assertions in the test case for #458
@zzzDavid zzzDavid closed this as completed May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant