Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix remaining tautologies in tests
  • Loading branch information
ndgrigorian committed Aug 4, 2026
commit 587a16916ea25064c375bd3dd7debb531e346c6a
22 changes: 9 additions & 13 deletions libsyclinterface/tests/test_sycl_device_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,17 @@ TEST_P(TestDPCTLSyclDeviceInterface, ChkGetMaxWorkGroupSize)
{
size_t n = 0;
EXPECT_NO_FATAL_FAILURE(n = DPCTLDevice_GetMaxWorkGroupSize(DRef));
if (DPCTLDevice_IsAccelerator(DRef))
EXPECT_TRUE(n >= 0);
else
// accelerators may report 0, all other devices must report a positive value
if (!DPCTLDevice_IsAccelerator(DRef))
EXPECT_TRUE(n > 0);
}

TEST_P(TestDPCTLSyclDeviceInterface, ChkGetMaxNumSubGroups)
{
size_t n = 0;
EXPECT_NO_FATAL_FAILURE(n = DPCTLDevice_GetMaxNumSubGroups(DRef));
if (DPCTLDevice_IsAccelerator(DRef))
EXPECT_TRUE(n >= 0);
else
// accelerators may report 0, all other devices must report a positive value
if (!DPCTLDevice_IsAccelerator(DRef))
EXPECT_TRUE(n > 0);
}

Expand All @@ -203,9 +201,8 @@ TEST_P(TestDPCTLSyclDeviceInterface, ChkGetSubGroupSizes)
size_t *sg_sizes = nullptr;
EXPECT_NO_FATAL_FAILURE(
sg_sizes = DPCTLDevice_GetSubGroupSizes(DRef, &sg_sizes_len));
if (DPCTLDevice_IsAccelerator(DRef))
EXPECT_TRUE(sg_sizes_len >= 0);
else
// accelerators may report 0, all other devices must report a positive value
if (!DPCTLDevice_IsAccelerator(DRef))
EXPECT_TRUE(sg_sizes_len > 0);
for (size_t i = 0; i < sg_sizes_len; ++i) {
EXPECT_TRUE(sg_sizes[i] > 0);
Expand Down Expand Up @@ -495,7 +492,6 @@ TEST_P(TestDPCTLSyclDeviceInterface, ChkGetPartitionMaxSubDevices)
size_t max_cu = 0;
EXPECT_NO_FATAL_FAILURE(max_part =
DPCTLDevice_GetPartitionMaxSubDevices(DRef));
EXPECT_TRUE(max_part >= 0);
EXPECT_NO_FATAL_FAILURE(max_cu = DPCTLDevice_GetMaxComputeUnits(DRef));
EXPECT_TRUE(max_part <= max_cu);
}
Expand Down Expand Up @@ -533,10 +529,10 @@ TEST_P(TestDPCTLSyclDeviceInterface, ChkGetGetMaxClockFrequency)
{
uint32_t res = 0;
EXPECT_NO_FATAL_FAILURE(res = DPCTLDevice_GetMaxClockFrequency(DRef));
// FIXME: uncomment once coverage build transitions away
// FIXME: from using DPC++ 2023.2
EXPECT_TRUE(res >= 0);
// EXPECT_TRUE(res != 0);
// FIXME: DPC++ may return 0 for some CPUs
// unknown whether bug or expected behavior
// EXPECT_TRUE(res > 0);
}

TEST_P(TestDPCTLSyclDeviceInterface, ChkGetGlobalMemCacheType)
Expand Down