Skip to content

Commit 2b7e6f8

Browse files
authored
fix: skip BufferLargerThan4GB test when max alloc size exceeded (#342)
Signed-off-by: Oskar Hubert Weber <[email protected]>
1 parent 9fc3061 commit 2b7e6f8

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

conformance_tests/core/test_module/src/test_module.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,25 +1338,28 @@ void zeKernelLaunchTests::RunGivenBufferLargerThan4GBWhenExecutingFunction(
13381338
size_t head = 4096;
13391339
size_t reference_buffer_size = 4096 * 1024;
13401340

1341-
LOG_DEBUG << "Memory Properties: " << mem_properties.size();
1342-
LOG_DEBUG << "Total available memory: " << total_mem;
1343-
LOG_DEBUG << "Available host memory: " << available_host_mem;
1344-
LOG_DEBUG << "Max Mem alloc size: " << device_properties.maxMemAllocSize;
1345-
LOG_DEBUG << "Allocation size: " << alloc_size;
1341+
LOG_INFO << "Memory Properties: " << mem_properties.size();
1342+
LOG_INFO << "Total device memory: " << total_mem;
1343+
LOG_INFO << "Available host memory: " << available_host_mem;
1344+
LOG_INFO << "Max Mem alloc size: " << device_properties.maxMemAllocSize;
1345+
LOG_INFO << "Allocation size: " << alloc_size;
13461346

13471347
if (alloc_size > available_host_mem) {
13481348
GTEST_SKIP() << "Required allocation size is greater than available host "
13491349
"memory, skipping test";
13501350
}
13511351

1352-
if (alloc_size > mem_properties[0].totalSize) {
1352+
if (alloc_size > device_properties.maxMemAllocSize) {
1353+
GTEST_SKIP()
1354+
<< "Required allocation size is greater than max allocation size, "
1355+
"skipping test";
1356+
}
1357+
1358+
if (alloc_size > total_mem) {
13531359
GTEST_SKIP() << "Required allocation size is greater than total memory, "
13541360
"skipping test";
13551361
}
13561362

1357-
size_t difference =
1358-
mem_properties[0].totalSize - device_properties.maxMemAllocSize;
1359-
13601363
uint8_t *reference_buffer, *head_buffer;
13611364
try {
13621365
reference_buffer = new uint8_t[reference_buffer_size];

0 commit comments

Comments
 (0)