(self)
| 187 | |
| 188 | @needs_second_gpu |
| 189 | def test_copies_2_devs(self): |
| 190 | self.skip_if_not_multigraph() |
| 191 | d0, d1 = Device.DEFAULT, f"{Device.DEFAULT}:1" |
| 192 | b0 = [make_buffer(d0, fill=True) for _ in range(3)] |
| 193 | b1 = [make_buffer(d1, fill=True)] |
| 194 | c: dict[Buffer,UOp] = {} |
| 195 | |
| 196 | calls = [ |
| 197 | UOp(Ops.COPY).call(get_buf_uop(b1[0],c), get_buf_uop(b0[0],c), metadata=()), |
| 198 | get_ast(d0, 2).call(get_buf_uop(b0[2],c), get_buf_uop(b0[0],c), get_buf_uop(b0[1],c), metadata=()), |
| 199 | ] |
| 200 | |
| 201 | out = [b1[0], b0[2]] |
| 202 | zero_bufs(out) |
| 203 | run_schedule(calls) |
| 204 | expected = {buf: np.frombuffer(buf.as_memoryview(), np.int32).copy() for buf in b0 + b1} |
| 205 | |
| 206 | for _ in range(RUN_CNT): |
| 207 | zero_bufs(out) |
| 208 | make_graph(Device[d0].graph, calls)([], {}) |
| 209 | for buf in b0 + b1: np.testing.assert_equal(expected[buf], np.frombuffer(buf.as_memoryview(), np.int32)) |
| 210 | |
| 211 | def test_graph_offset_bufs(self): |
| 212 | self.skip_if_not_multigraph() |
nothing calls this directly
no test coverage detected