From a0af1045bfb68208948d53bbdcc70c65ef971209 Mon Sep 17 00:00:00 2001 From: calledit <1573053+calledit@users.noreply.github.com> Date: Thu, 26 Jan 2023 00:40:19 +0100 Subject: [PATCH] Some new tests (#440) * Make test run * Added new tests: sub pow constant_sub * Fix indentation * Added one to many lines * Fix indentation * Update test_cl_tiler.py * Delete test_cl_tiler.py --- test/test_speed_v_torch.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/test_speed_v_torch.py b/test/test_speed_v_torch.py index c801ceb49e..a43f08d9b7 100644 --- a/test/test_speed_v_torch.py +++ b/test/test_speed_v_torch.py @@ -80,6 +80,22 @@ class TestSpeed(unittest.TestCase): global prefix prefix = " " if prefix is None else "" return super().setUp() + + def test_sub(self): + def f(a, b): return a-b + helper_test_generic_square('sub', 4096, f, f) + + def test_constant_sub(self): + def f(a, b): return 1.0-a + helper_test_generic_square('sub', 4096, f, f) + + def test_constant_zero_sub(self): + def f(a, b): return 0.0-a + helper_test_generic_square('sub', 4096, f, f) + + def test_pow(self): + def f(a, b): return a.pow(b) + helper_test_generic_square('pow', 2048, f, f) def test_sum(self): def f(a, b): return a.sum()