support running several kernels #91

Closed
opened 2021-11-10 21:20:51 +08:00 by sb10q · 0 comments

We need to be able to run several kernels in the same NAC3 session, caching as much data (ast, compilation results) as possible.

This currently does not work:

from numpy import float64
from min_artiq import *

@nac3
class Demo:
    core: KernelInvariant[Core]

    def __init__(self):
        self.core = Core()

    @kernel
    def k1(self):
        pass

    @kernel
    def k2(self):
        pass


if __name__ == "__main__":
    demo = Demo()
    demo.k1()
    demo.k2()
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: "duplicate top level function define"', nac3artiq/src/lib.rs:361:14
We need to be able to run several kernels in the same NAC3 session, caching as much data (ast, compilation results) as possible. This currently does not work: ```python from numpy import float64 from min_artiq import * @nac3 class Demo: core: KernelInvariant[Core] def __init__(self): self.core = Core() @kernel def k1(self): pass @kernel def k2(self): pass if __name__ == "__main__": demo = Demo() demo.k1() demo.k2() ``` ``` thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: "duplicate top level function define"', nac3artiq/src/lib.rs:361:14 ```
sb10q added the
high-priority
label 2021-11-17 16:21:49 +08:00
sb10q added this to the Prealpha milestone 2021-11-19 16:48:17 +08:00
sb10q closed this issue 2021-12-05 13:11:32 +08:00
Sign in to join this conversation.
No Milestone
No Assignees
1 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#91
There is no content yet.