~magnusmorton/delayrepay

ff42318840e4d3083f491667fc4dac7be38d039a — Magnus Morton 6 months ago 160c451
removed bench.py
1 files changed, 0 insertions(+), 29 deletions(-)

D tests/bench.py
D tests/bench.py => tests/bench.py +0 -29
@@ 1,29 0,0 @@
import sys
import importlib
import timeit

pkg = sys.argv[1]
np = importlib.import_module(pkg)


LAPTOP_MAX = 83361790

SPA_MAX = 153000000

size = LAPTOP_MAX
data = np.random.random((size,))

def func():
    res = np.sin(data) ** 2 + np.cos(data) ** 2
    if np.__name__ == "delayrepay":
        res.get()
        np.cuda.Device().synchronize()
    elif np.__name__ == "cupy":
        res.get()
        np.cuda.Device().synchronize()



print(min(timeit.repeat(func, repeat=100, number=1)))

#rint(f"time: {now-then}")