[FRONTEND] improved caching mechanism (#474)

Co-authored-by: Greg Brockman <gdb@gregbrockman.com>
Co-authored-by: Christopher Hesse <christopherhesse@users.noreply.github.com>
This commit is contained in:
Philippe Tillet
2022-03-15 12:20:51 -07:00
committed by GitHub
parent 21f8a0646d
commit d4d8eaf6c0
3 changed files with 106 additions and 84 deletions

View File

@@ -76,7 +76,7 @@ def reset_tmp_dir():
def test_reuse():
counter = 0
def inc_counter(key, binary, repr):
def inc_counter(*args, **kwargs):
nonlocal counter
counter += 1
JITFunction.cache_hook = inc_counter
@@ -91,7 +91,7 @@ def test_reuse():
def test_specialize(mode):
counter = 0
def inc_counter(key, binary, repr):
def inc_counter(*args, **kwargs):
nonlocal counter
counter += 1
JITFunction.cache_hook = inc_counter