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

Vulkan backend fails to detect add overflow in some cases #6844

Open
ailzhang opened this issue Dec 9, 2022 · 2 comments
Open

Vulkan backend fails to detect add overflow in some cases #6844

ailzhang opened this issue Dec 9, 2022 · 2 comments
Assignees

Comments

@ailzhang
Copy link
Contributor

ailzhang commented Dec 9, 2022

The following script doesn't throw an overflow message,

import taichi as ti
ti.init(ti.vulkan, debug=True)

def test_add_overflow():
    ty = ti.u8
    num = 2 ** 7

    @ti.kernel
    def foo(num: ti.u32) -> ty:
        a = ty(num)
        b = ty(num)
        return a + b

    print(foo(num))
    ti.sync()
test_add_overflow()

But this throws as expected:

import taichi as ti
ti.init(ti.vulkan, debug=True)

def test_add_overflow():
    ty = ti.u8
    num = 2 ** 7

    @ti.kernel
    def foo() -> ty:
        a = ty(num)
        b = ty(num)
        return a + b

    print(foo())
    ti.sync()
test_add_overflow()
@taichi-gardener taichi-gardener moved this to Untriaged in Taichi Lang Dec 9, 2022
@turbo0628 turbo0628 moved this from Untriaged to Todo in Taichi Lang Dec 9, 2022
@bobcao3
Copy link
Collaborator

bobcao3 commented Dec 11, 2022

I think this is disabled because of 470 drivers have a wrong implementation of OpIMulHigh or something

@ailzhang
Copy link
Contributor Author

FWIW this test passed on my workstation with 470.82 but not the other one with 470.161 lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

3 participants