MCPcopy Create free account
hub / github.com/YuminosukeSato/ironkernel / test_saxpy_1m

Method test_saxpy_1m

tests/python/test_kernel.py:33–41  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

31 assert out[99] == 199.0
32
33 def test_saxpy_1m(self) -> None:
34 a, x, y = kernel.args("a", "x", "y")
35 saxpy = kernel.elementwise(a * x + y)
36 bx = rt.asarray(np.arange(1_000_000, dtype=np.float64))
37 by = rt.asarray(np.ones(1_000_000, dtype=np.float64))
38 task = rt.go(kernel.map(saxpy, a=2.0, x=bx, y=by))
39 out = task.result().numpy()
40 assert out[0] == 1.0
41 assert out[-1] == 2.0 * 999999.0 + 1.0
42
43 def test_negation(self) -> None:
44 x = kernel.arg("x")

Callers

nothing calls this directly

Calls 7

numpyMethod · 0.80
argsMethod · 0.45
elementwiseMethod · 0.45
asarrayMethod · 0.45
goMethod · 0.45
mapMethod · 0.45
resultMethod · 0.45

Tested by

no test coverage detected