mirror of https://github.com/Nonannet/copapy.git
16 lines
407 B
Python
16 lines
407 B
Python
from copapy import value
|
|
from copapy.backend import Write, compile_to_dag, stencil_db_from_package
|
|
from copapy._binwrite import Command
|
|
|
|
input = value(9.0)
|
|
|
|
result = input ** 2 / 3.3 + 5
|
|
|
|
arch = 'native'
|
|
sdb = stencil_db_from_package(arch)
|
|
dw, _ = compile_to_dag([Write(result)], sdb)
|
|
|
|
# Instruct runner to dump patched code to a file:
|
|
dw.write_com(Command.DUMP_CODE)
|
|
|
|
dw.to_file('build/runner/test.copapy') |