Skip to content

Commit 43209ef

Browse files
authored
TESTS PERF add 4 math tests (#501)
1 parent 75375c3 commit 43209ef

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import numpy
2+
import pytest
3+
4+
from tests.tests_perf.data_generator import *
5+
from tests.tests_perf.test_perf_base import DPNPTestPerfBase
6+
7+
8+
class TestDPNPMathematical(DPNPTestPerfBase):
9+
10+
@pytest.mark.parametrize("func_name", ["add", "divide", "multiply", "subtract"])
11+
@pytest.mark.parametrize("dtype", [numpy.float64, numpy.float32, numpy.int64, numpy.int32])
12+
@pytest.mark.parametrize("size", [512, 1024, 2048, 4096, 8192, 16384, 32768])
13+
def test_math_2args(self, func_name, lib, dtype, size):
14+
input1 = gen_array_1d(lib, size, dtype=dtype, seed=self.seed)
15+
input2 = gen_array_1d(lib, size, dtype=dtype, seed=self.seed)
16+
17+
self.dpnp_benchmark(func_name, lib, dtype, input1.size, input1, input2)

tests/tests_perf/test_perf_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ def print_head(self):
113113
print(f"lib".center(pw[2]), end=self.sep)
114114
print(f"size".center(pw[3]), end=self.sep)
115115
print(f"median".center(pwn), end=self.sep)
116-
print(f"max".center(pwn), end=self.sep)
117116
print(f"min".center(pwn), end=self.sep)
117+
print(f"max".center(pwn), end=self.sep)
118118
print()
119119

120120
def print_csv(self):

0 commit comments

Comments
 (0)