Idein / py-videocore6

Python library for GPGPU programming on Raspberry Pi 4
https://idein.jp
GNU General Public License v2.0
247 stars 28 forks source link

Add dump_code to dump assembled program #35

Closed Terminus-IMRC closed 4 years ago

Terminus-IMRC commented 4 years ago

Before this change, we had to assemble a QPU program again to dump even if it is already assembled, which is inconvenient with many and complex arguments:

@qpu
def qpu_program(asm, arg1, arg2, arg3):
    ...

with Driver() as drv:
    code = drv.program(qpu_program, lots_of_calc1, lots_of_calc2, lots_of_calc3)
    drv.dump_program(qpu_program, lots_of_calc1, lots_of_calc2, lots_of_calc3)
    ...

After the change, we need to assemble the program only once:

with Driver() as drv:
    code = drv.program(qpu_program, lots_of_calc1, lots_of_calc2, lots_of_calc3)
    drv.dump_code(code)
    ...
Terminus-IMRC commented 4 years ago

Thanks!