Skip to content

Commit c310169

Browse files
authored
[UR] SuccessGlobalMemoryFreeSize test updated to check once (#18093)
This test checked that two successive calls to `urDeviceGetInfo(UR_DEVICE_INFO_GLOBAL_MEM_FREE)` return the same value. This doesn't make sense as allocations (perhaps from other processes or threads) can happen or be freed between the calls. Instead we only check to see that a value has been written.
1 parent 491915b commit c310169

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

unified-runtime/test/conformance/device/urDeviceGetInfo.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -806,8 +806,6 @@ TEST_P(urDeviceGetInfoTest, SuccessGlobalMemorySize) {
806806
}
807807

808808
TEST_P(urDeviceGetInfoTest, SuccessGlobalMemoryFreeSize) {
809-
UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}, uur::NativeCPU{});
810-
811809
size_t property_size = 0;
812810
const ur_device_info_t property_name = UR_DEVICE_INFO_GLOBAL_MEM_FREE;
813811

@@ -816,11 +814,12 @@ TEST_P(urDeviceGetInfoTest, SuccessGlobalMemoryFreeSize) {
816814
property_name);
817815
ASSERT_EQ(property_size, sizeof(uint64_t));
818816

819-
uint64_t property_value = 0;
820-
ASSERT_QUERY_RETURNS_VALUE(urDeviceGetInfo(device, property_name,
821-
property_size, &property_value,
822-
nullptr),
823-
property_value);
817+
// Free memory can be any value (even 0), but we assume that UR will not
818+
// run in environments with devices with 18EiB of memory
819+
uint64_t property_value = std::numeric_limits<uint64_t>::max();
820+
ASSERT_SUCCESS(urDeviceGetInfo(device, property_name, property_size,
821+
&property_value, nullptr));
822+
ASSERT_NE(property_value, std::numeric_limits<uint64_t>::max());
824823
}
825824

826825
TEST_P(urDeviceGetInfoTest, SuccessMaxConstantBufferSize) {

0 commit comments

Comments
 (0)