From 03f45391348aa3fe9a62458716b80103b9df9296 Mon Sep 17 00:00:00 2001 From: Austin Ho Date: Thu, 14 Nov 2024 17:11:27 +0000 Subject: [PATCH] #13655: Fix sub-device tests for BH Was not accounting for alignment when calculating expected addresses --- .../unit_tests_fast_dispatch/sub_device/test_sub_device.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/tt_metal/tt_metal/unit_tests_fast_dispatch/sub_device/test_sub_device.cpp b/tests/tt_metal/tt_metal/unit_tests_fast_dispatch/sub_device/test_sub_device.cpp index c5d074a8f15..83ef6759c4d 100644 --- a/tests/tt_metal/tt_metal/unit_tests_fast_dispatch/sub_device/test_sub_device.cpp +++ b/tests/tt_metal/tt_metal/unit_tests_fast_dispatch/sub_device/test_sub_device.cpp @@ -184,7 +184,7 @@ TEST_F(CommandQueueSingleCardFixture, TestSubDeviceAllocations) { device->load_sub_device_manager(sub_device_manager_1); auto buffer_1 = CreateBuffer(shard_config_1, SubDeviceId{0}); - EXPECT_EQ(buffer_1->address(), max_addr - page_size_1); + EXPECT_EQ(buffer_1->address(), max_addr - buffer_1->aligned_page_size()); EnqueueWriteBuffer(device->command_queue(), buffer_1, input_1, false); std::vector output_1; EnqueueReadBuffer(device->command_queue(), buffer_1, output_1, true); @@ -206,7 +206,7 @@ TEST_F(CommandQueueSingleCardFixture, TestSubDeviceAllocations) { device->load_sub_device_manager(sub_device_manager_2); auto buffer_3 = CreateBuffer(shard_config_2, SubDeviceId{1}); - EXPECT_EQ(buffer_3->address(), max_addr - page_size_2); + EXPECT_EQ(buffer_3->address(), max_addr - buffer_3->aligned_page_size()); EnqueueWriteBuffer(device->command_queue(), buffer_3, input_2, false); std::vector output_2; EnqueueReadBuffer(device->command_queue(), buffer_3, output_2, true); @@ -220,7 +220,7 @@ TEST_F(CommandQueueSingleCardFixture, TestSubDeviceAllocations) { } auto buffer_4 = CreateBuffer(shard_config_1, SubDeviceId{0}); - EXPECT_EQ(buffer_4->address(), max_addr - page_size_1); + EXPECT_EQ(buffer_4->address(), max_addr - buffer_4->aligned_page_size()); EXPECT_THROW(CreateBuffer(interleaved_config, SubDeviceId{0}), std::exception); } }