MCPcopy Create free account
hub / github.com/numpy/numpy / test_arithmetic_subadd

Method test_arithmetic_subadd

numpy/core/tests/test_simd.py:1135–1149  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1133 assert edata == (data_lo, data_hi)
1134
1135 def test_arithmetic_subadd(self):
1136 if self._is_fp():
1137 data_a = self._data()
1138 else:
1139 data_a = self._data(self._int_max() - self.nlanes)
1140 data_b = self._data(self._int_min(), reverse=True)
1141 vdata_a, vdata_b = self.load(data_a), self.load(data_b)
1142
1143 # non-saturated
1144 data_add = self.load([a + b for a, b in zip(data_a, data_b)]) # load to cast
1145 add = self.add(vdata_a, vdata_b)
1146 assert add == data_add
1147 data_sub = self.load([a - b for a, b in zip(data_a, data_b)])
1148 sub = self.sub(vdata_a, vdata_b)
1149 assert sub == data_sub
1150
1151 def test_arithmetic_mul(self):
1152 if self.sfx in ("u64", "s64"):

Callers

nothing calls this directly

Calls 5

_is_fpMethod · 0.80
_int_maxMethod · 0.80
_int_minMethod · 0.80
_dataMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected