LLVM ERROR: Type mismatch in constant table! #225

Closed
opened 2022-03-20 10:09:40 +08:00 by sb10q · 3 comments

reported by @ychenfo

from min_artiq import *
from numpy import int32
from typing import TypeVar, Generic

@extern
def print_int32(x: int32):
    ...

T = TypeVar('T', int32, bool)

@nac3
class A(Generic[T]):
    a: Kernel[int32]
    b: Kernel[T]
    def __init__(self, b: T):
        self.a = 3
        self.b = b

a1 = A(5)
a2 = A(False)

@nac3
class Demo:
    core: KernelInvariant[Core]
    def __init__(self):
        self.core = Core()

    @kernel
    def run(self):
        print_int32(int32(a1.b))
        print_int32(int32(a2.b))

if __name__ == "__main__":
    Demo().run()
LLVM ERROR: Type mismatch in constant table!
Aborted
reported by @ychenfo ```python from min_artiq import * from numpy import int32 from typing import TypeVar, Generic @extern def print_int32(x: int32): ... T = TypeVar('T', int32, bool) @nac3 class A(Generic[T]): a: Kernel[int32] b: Kernel[T] def __init__(self, b: T): self.a = 3 self.b = b a1 = A(5) a2 = A(False) @nac3 class Demo: core: KernelInvariant[Core] def __init__(self): self.core = Core() @kernel def run(self): print_int32(int32(a1.b)) print_int32(int32(a2.b)) if __name__ == "__main__": Demo().run() ``` ``` LLVM ERROR: Type mismatch in constant table! Aborted ```
Collaborator

Although not fully clear the cause of the problem.. this seems to be fixed under the lastest commit d9be8d3978

Although not fully clear the cause of the problem.. this seems to be fixed under the lastest commit https://git.m-labs.hk/M-Labs/nac3/commit/d9be8d3978f01e0651a344eb7b10e884dd4991bc
Poster
Owner

Well, looks like this wasn't fixed. #241

Well, looks like this wasn't fixed. https://git.m-labs.hk/M-Labs/nac3/issues/241

Well, looks like this wasn't fixed. #241

They have the same message but the causes are completely different.

> Well, looks like this wasn't fixed. https://git.m-labs.hk/M-Labs/nac3/issues/241 They have the same message but the causes are completely different.
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/nac3#225
There is no content yet.