mirror of https://github.com/Nonannet/copapy.git
code style fixed
This commit is contained in:
parent
52f5b28017
commit
79f1fc80a9
5
.flake8
5
.flake8
|
|
@ -13,8 +13,7 @@ exclude =
|
|||
build,
|
||||
dist,
|
||||
.conda,
|
||||
.venv,
|
||||
tests/autogenerated_*
|
||||
.venv
|
||||
|
||||
# Enable specific plugins or options
|
||||
# Example: Enabling flake8-docstrings
|
||||
|
|
@ -22,4 +21,4 @@ select = C,E,F,W,D
|
|||
|
||||
# Specify custom error codes to ignore or enable
|
||||
per-file-ignores =
|
||||
tests/*: D
|
||||
tests/*: D, E712
|
||||
|
|
@ -62,10 +62,12 @@ def get_last_call_in_function(func: elf_symbol) -> int:
|
|||
assert reloc, f'No call function in stencil function {func.name}.'
|
||||
return reloc.fields['r_offset'] - func.fields['st_value'] - reloc.fields['r_addend'] - LENGTH_CALL_INSTRUCTION
|
||||
|
||||
|
||||
def symbol_is_stencil(sym: elf_symbol) -> bool:
|
||||
return (sym.info == 'STT_FUNC' and len(sym.relocations) > 0 and
|
||||
sym.relocations[-1].symbol.info == 'STT_NOTYPE')
|
||||
|
||||
|
||||
class stencil_database():
|
||||
"""A class for loading and querying a stencil database from an ELF object file
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ if __name__ == "__main__":
|
|||
rel_entr_point = dr.read_int()
|
||||
print(f"ENTRY_POINT rel_entr_point={rel_entr_point}")
|
||||
elif com == Command.RUN_PROG:
|
||||
print(f"RUN_PROG")
|
||||
print("RUN_PROG")
|
||||
elif com == Command.READ_DATA:
|
||||
offs = dr.read_int()
|
||||
size = dr.read_int()
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ stencil_func_prefix = '__attribute__((naked)) ' # Remove callee prolog
|
|||
|
||||
stack_size = 64
|
||||
|
||||
|
||||
def get_aux_funcs() -> str:
|
||||
return f"""
|
||||
{entry_func_prefix}int entry_function_shell(){{
|
||||
|
|
@ -17,8 +18,8 @@ def get_aux_funcs() -> str:
|
|||
result_int(0);
|
||||
return 1;
|
||||
}}
|
||||
""" + \
|
||||
"""
|
||||
|
||||
""" + """
|
||||
__attribute__((noinline)) int floor_div(float arg1, float arg2) {
|
||||
float x = arg1 / arg2;
|
||||
int i = (int)x;
|
||||
|
|
|
|||
Loading…
Reference in New Issue