| 564 | // clang-format on |
| 565 | |
| 566 | TEST_P(JIT, Tile) { |
| 567 | tile_params params = GetParam(); |
| 568 | size_t alloc_bytes, alloc_buffers; |
| 569 | size_t lock_bytes, lock_buffers; |
| 570 | size_t alloc_bytes2, alloc_buffers2; |
| 571 | size_t lock_bytes2, lock_buffers2; |
| 572 | af::deviceMemInfo(&alloc_bytes, &alloc_buffers, &lock_bytes, &lock_buffers); |
| 573 | array out = tile(in, params.tile); |
| 574 | af::deviceMemInfo(&alloc_bytes2, &alloc_buffers2, &lock_bytes2, |
| 575 | &lock_buffers2); |
| 576 | |
| 577 | // Make sure that the dimensions we are testing here are JIT nodes |
| 578 | // by checking that no new buffers are created. |
| 579 | ASSERT_EQ(alloc_bytes, alloc_bytes2) |
| 580 | << "Tile operation created a buffer therefore not a JIT node"; |
| 581 | ASSERT_EQ(alloc_buffers, alloc_buffers2) |
| 582 | << "Tile operation created a buffer therefore not a JIT node"; |
| 583 | ASSERT_EQ(lock_bytes, lock_bytes2) |
| 584 | << "Tile operation created a buffer therefore not a JIT node"; |
| 585 | ASSERT_EQ(alloc_buffers, alloc_buffers2) |
| 586 | << "Tile operation created a buffer therefore not a JIT node"; |
| 587 | |
| 588 | ASSERT_VEC_ARRAY_EQ(gold, params.out_dim, out); |
| 589 | } |
| 590 | |
| 591 | /// This test creates a large jit tree with very small buffers. I am |
| 592 | /// performing random JIT operations on the arrays. In each iteration |