From 93cbebe887ef0f51cd0924e2a8535ab38aab8a05 Mon Sep 17 00:00:00 2001 From: Rafal Rudnicki Date: Tue, 21 Oct 2025 13:32:40 +0000 Subject: [PATCH 1/2] if size_t to uint32_t warning --- test/common/level_zero_mocks.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/common/level_zero_mocks.cpp b/test/common/level_zero_mocks.cpp index 4fc566bb2..8d64ba859 100644 --- a/test/common/level_zero_mocks.cpp +++ b/test/common/level_zero_mocks.cpp @@ -21,6 +21,7 @@ LevelZeroMock::initializeMemoryProviderWithResidentDevices( ze_device_handle_t device, std::vector residentDevices, ze_context_handle_t context, ze_device_properties_t device_properties, ze_memory_allocation_properties_t memory_allocation_properties) { + umf_level_zero_memory_provider_params_handle_t params = nullptr; EXPECT_EQ(umfLevelZeroMemoryProviderParamsCreate(¶ms), UMF_RESULT_SUCCESS); @@ -31,10 +32,10 @@ LevelZeroMock::initializeMemoryProviderWithResidentDevices( EXPECT_EQ(umfLevelZeroMemoryProviderParamsSetMemoryType( params, UMF_MEMORY_TYPE_DEVICE), UMF_RESULT_SUCCESS); - - EXPECT_EQ(umfLevelZeroMemoryProviderParamsSetResidentDevices( - params, residentDevices.data(), residentDevices.size()), - UMF_RESULT_SUCCESS); + EXPECT_EQ( + umfLevelZeroMemoryProviderParamsSetResidentDevices( + params, residentDevices.data(), (uint32_t)residentDevices.size()), + UMF_RESULT_SUCCESS); // query min page size operation upon provider initialization EXPECT_CALL(*this, zeDeviceGetProperties(device, _)) From 1afb11346a06761d8b707b450c964678a08d1dc4 Mon Sep 17 00:00:00 2001 From: Rafal Rudnicki Date: Tue, 21 Oct 2025 14:12:50 +0000 Subject: [PATCH 2/2] disable MSVC C6285 warning produced by gtest --- test/pools/pool_residency.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/pools/pool_residency.cpp b/test/pools/pool_residency.cpp index ba88076f3..26ed99e37 100644 --- a/test/pools/pool_residency.cpp +++ b/test/pools/pool_residency.cpp @@ -9,6 +9,13 @@ #include "pool.hpp" #include "gtest/gtest.h" +// On MSVC disable C6285 warning produced by gtest: +// ( || ) is always a non-zero constant. +// Did you intend to use the bitwise-and operator? +#ifdef _MSC_VER +#pragma warning(disable : 6285) +#endif + using namespace testing; class PoolResidencyTestFixture : public Test { @@ -53,6 +60,7 @@ TEST_F(PoolResidencyTestFixture, EXPECT_CALL(l0mock, zeMemAllocDevice(CONTEXT, _, _, _, OUR_DEVICE, _)) .WillOnce( DoAll(SetArgPointee<5>(POINTER_0), Return(ZE_RESULT_SUCCESS))); + EXPECT_CALL(l0mock, zeContextMakeMemoryResident(CONTEXT, DEVICE_0, _, _)) .WillOnce(Return(ZE_RESULT_SUCCESS)); EXPECT_CALL(l0mock, zeContextMakeMemoryResident(CONTEXT, DEVICE_1, _, _))