(self)
| 24 | @unittest.skipIf(Device.DEFAULT == "WEBGPU", "webgpu does extra load/store for packed types") |
| 25 | class TestMemoryCount(unittest.TestCase): |
| 26 | def test_add(self): |
| 27 | a = Tensor.empty(1024, 1024, dtype=dtypes.uint8) |
| 28 | b = Tensor.empty(1024, 1024, dtype=dtypes.uint8) |
| 29 | _, mem = get_stats(a+b) |
| 30 | self.assertEqual(mem, 1024*1024*3) # 2 reads + 1 write |
| 31 | |
| 32 | def test_add_const(self): |
| 33 | a = Tensor.empty(1024, 1024, dtype=dtypes.uint8) |