Skip to content

Commit

Permalink
#13655: Fix sub-device tests for BH
Browse files Browse the repository at this point in the history
Was not accounting for alignment when calculating expected addresses
  • Loading branch information
tt-aho committed Nov 14, 2024
1 parent 52742eb commit 03f4539
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint32_t> output_1;
EnqueueReadBuffer(device->command_queue(), buffer_1, output_1, true);
Expand All @@ -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<uint32_t> output_2;
EnqueueReadBuffer(device->command_queue(), buffer_3, output_2, true);
Expand All @@ -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);
}
}
Expand Down

0 comments on commit 03f4539

Please sign in to comment.