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

[Fixbug][Hidet Script] Fix a bug that hidet script does not recognize return type #329

Merged
merged 2 commits into from Jul 25, 2023

Conversation

yaoyaoding
Copy link
Member

Fix hidet script transpiler to run recognize the following code

def test_unroll():
    from hidet.lang import printf, attrs
    from hidet.ir.dtypes import float32x8, float32
    from hidet.ir import primitives
    from hidet.lang import address, cast

    with hidet.script_module() as script_module:

        @hidet.script
        def example() -> float32x8:
            attrs.func_kind = 'cpu_internal'
            return primitives.cpu.avx_f32x8_setzero()

        @hidet.script
        def main():
            attrs.func_kind = 'cpu_kernel'

            a = example()
            a_unpacked = cast(address(a), ~float32)
            for i in range(8):
                printf("%f ", a_unpacked[i])
            printf("\n")

    func = script_module.build()
    func()

    return func

Previously, hidet can not recognize the float32x8 return type.

@yaoyaoding yaoyaoding merged commit b356f3d into hidet-org:main Jul 25, 2023
2 checks passed
@yaoyaoding yaoyaoding deleted the fix-hidet-script-bug branch July 25, 2023 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant