(self)
| 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") |