diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a080b9b3c..4dba2e2277 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -129,7 +129,7 @@ if(NOT DEFINED AUB_STREAM_DIR AND NOT DISABLE_AUB_STREAM) endif() else() unset(AUB_STREAM_DIR) -endif(NOT DEFINED AUB_STREAM_DIR) +endif() if(LIBDRM_DIR) get_filename_component(I915_INCLUDES_DIR "${LIBDRM_DIR}/include" ABSOLUTE) @@ -469,7 +469,10 @@ endif() if(MSVC) # Force to treat warnings as errors if(NOT CMAKE_CXX_FLAGS MATCHES "/WX") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX") + if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /we4189") + endif() endif() # Support for WUD diff --git a/offline_compiler/utilities/windows/seh_exception.cpp b/offline_compiler/utilities/windows/seh_exception.cpp index b821c143f7..750c9b600b 100644 --- a/offline_compiler/utilities/windows/seh_exception.cpp +++ b/offline_compiler/utilities/windows/seh_exception.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Intel Corporation + * Copyright (C) 2018-2019 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -73,6 +73,10 @@ void SehException::getCallStack(unsigned int code, struct _EXCEPTION_POINTERS *e stack.clear(); BOOL result = SymInitialize(hProcess, NULL, TRUE); + if (result == FALSE) { + return; + } + STACKFRAME64 stackFrame; memset(&stackFrame, 0, sizeof(STACKFRAME64)); const int nameSize = 255; diff --git a/runtime/os_interface/windows/device_factory_win.cpp b/runtime/os_interface/windows/device_factory_win.cpp index aabbd5859d..1d63d38ccb 100644 --- a/runtime/os_interface/windows/device_factory_win.cpp +++ b/runtime/os_interface/windows/device_factory_win.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2018 Intel Corporation + * Copyright (C) 2017-2019 Intel Corporation * * SPDX-License-Identifier: MIT * diff --git a/runtime/os_interface/windows/kmdaf_listener.cpp b/runtime/os_interface/windows/kmdaf_listener.cpp index 8b7e17eed9..0a9c3266c1 100644 --- a/runtime/os_interface/windows/kmdaf_listener.cpp +++ b/runtime/os_interface/windows/kmdaf_listener.cpp @@ -1,12 +1,15 @@ /* - * Copyright (C) 2018 Intel Corporation + * Copyright (C) 2018-2019 Intel Corporation * * SPDX-License-Identifier: MIT * */ #include "runtime/os_interface/windows/kmdaf_listener.h" +#pragma warning(push) // save the current state +#pragma warning(disable : 4189) // disable warning 4189 (unused local variable) #include "kmdaf.h" +#pragma warning(pop) // restore state. namespace OCLRT { diff --git a/runtime/os_interface/windows/thk_wrapper.h b/runtime/os_interface/windows/thk_wrapper.h index bc06385acd..853a409a0a 100644 --- a/runtime/os_interface/windows/thk_wrapper.h +++ b/runtime/os_interface/windows/thk_wrapper.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2018 Intel Corporation + * Copyright (C) 2017-2019 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -80,8 +80,7 @@ class ThkWrapper { SYSTEM_ENTER() NTSTATUS Status; Status = mFunc(param); - unsigned int ID = getId(); - SYSTEM_LEAVE(ID); + SYSTEM_LEAVE(getId()); return Status; } else { return mFunc(param); diff --git a/runtime/os_interface/windows/wddm/wddm.cpp b/runtime/os_interface/windows/wddm/wddm.cpp index fa3c1e178c..2a424f7634 100644 --- a/runtime/os_interface/windows/wddm/wddm.cpp +++ b/runtime/os_interface/windows/wddm/wddm.cpp @@ -943,7 +943,7 @@ bool Wddm::init(PreemptionMode preemptionMode) { EvictionStatus Wddm::evictAllTemporaryResources() { decltype(temporaryResources) resourcesToEvict; - auto &lock = acquireLock(temporaryResourcesLock); + auto lock = acquireLock(temporaryResourcesLock); temporaryResources.swap(resourcesToEvict); if (resourcesToEvict.empty()) { return EvictionStatus::NOT_APPLIED; @@ -959,7 +959,7 @@ EvictionStatus Wddm::evictAllTemporaryResources() { } EvictionStatus Wddm::evictTemporaryResource(WddmAllocation &allocation) { - auto &lock = acquireLock(temporaryResourcesLock); + auto lock = acquireLock(temporaryResourcesLock); auto position = std::find(temporaryResources.begin(), temporaryResources.end(), allocation.handle); if (position == temporaryResources.end()) { return EvictionStatus::NOT_APPLIED; diff --git a/runtime/sharings/d3d/d3d_sharing.cpp b/runtime/sharings/d3d/d3d_sharing.cpp index 4cb9b5af32..cc0ee2fea3 100644 --- a/runtime/sharings/d3d/d3d_sharing.cpp +++ b/runtime/sharings/d3d/d3d_sharing.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2018 Intel Corporation + * Copyright (C) 2017-2019 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -41,8 +41,6 @@ D3DSharing::~D3DSharing() { template void D3DSharing::synchronizeObject(UpdateData &updateData) { - void *sharedHandle = nullptr; - sharingFunctions->getDeviceContext(d3dQuery); if (!sharedResource) { sharingFunctions->copySubresourceRegion(resourceStaging, 0, resource, subresource); diff --git a/unit_tests/device/device_win_timers_tests.cpp b/unit_tests/device/device_win_timers_tests.cpp index 11997bab69..2da2010cbb 100644 --- a/unit_tests/device/device_win_timers_tests.cpp +++ b/unit_tests/device/device_win_timers_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2018 Intel Corporation + * Copyright (C) 2017-2019 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -22,7 +22,9 @@ TEST_F(MockOSTimeWinTest, DynamicResolution) { auto wddmMock = std::unique_ptr(new WddmMock()); auto mDev = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(nullptr)); - bool error = wddmMock->init(mDev->getPreemptionMode()); + bool success = wddmMock->init(mDev->getPreemptionMode()); + EXPECT_TRUE(success); + std::unique_ptr timeWin(new MockOSTimeWin(wddmMock.get())); double res = 0.0; diff --git a/unit_tests/gen9/windows/os_interface_tests_gen9.cpp b/unit_tests/gen9/windows/os_interface_tests_gen9.cpp index b69a55722c..7d86612c8e 100644 --- a/unit_tests/gen9/windows/os_interface_tests_gen9.cpp +++ b/unit_tests/gen9/windows/os_interface_tests_gen9.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2018 Intel Corporation + * Copyright (C) 2017-2019 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -13,7 +13,6 @@ typedef OsInterfaceTest OsInterfaceTestSkl; GEN9TEST_F(OsInterfaceTestSkl, askKmdIfPreemptionRegisterWhitelisted) { HardwareInfo *hwInfo = nullptr; - const HardwareInfo *refHwinfo = *platformDevices; size_t numDevices = 0; ExecutionEnvironment executionEnvironment; diff --git a/unit_tests/main.cpp b/unit_tests/main.cpp index 3295b5805b..231066d059 100644 --- a/unit_tests/main.cpp +++ b/unit_tests/main.cpp @@ -172,13 +172,13 @@ int main(int argc, char **argv) { int retVal = 0; bool useDefaultListener = false; bool enable_alarm = true; - bool enable_segv = true; - bool enable_abrt = true; bool setupFeatureTable = testMode == TestMode::AubTests ? true : false; applyWorkarounds(); #if defined(__linux__) + bool enable_segv = true; + bool enable_abrt = true; if (getenv("IGDRCL_TEST_SELF_EXEC") == nullptr) { std::string wd = getRunPath(argv[0]); setenv("LD_LIBRARY_PATH", wd.c_str(), 1); diff --git a/unit_tests/mocks/mock_wddm.cpp b/unit_tests/mocks/mock_wddm.cpp index 2c35c8d739..1a22cc189c 100644 --- a/unit_tests/mocks/mock_wddm.cpp +++ b/unit_tests/mocks/mock_wddm.cpp @@ -81,7 +81,6 @@ bool WddmMock::destroyAllocation(WddmAllocation *alloc, OsContextWin *osContext) D3DKMT_HANDLE *allocationHandles = nullptr; uint32_t allocationCount = 0; D3DKMT_HANDLE resourceHandle = 0; - void *cpuPtr = nullptr; void *reserveAddress = alloc->getReservedAddress(); if (alloc->peekSharedHandle()) { resourceHandle = alloc->resourceHandle; diff --git a/unit_tests/os_interface/windows/device_command_stream_tests.cpp b/unit_tests/os_interface/windows/device_command_stream_tests.cpp index 5a5c31a095..c6853ec18d 100644 --- a/unit_tests/os_interface/windows/device_command_stream_tests.cpp +++ b/unit_tests/os_interface/windows/device_command_stream_tests.cpp @@ -204,7 +204,7 @@ TEST_F(WddmCommandStreamTest, givenGraphicsAllocationWithDifferentGpuAddressThen LinearStream cs(commandBuffer); BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs}; - auto flushStamp = csr->flush(batchBuffer, csr->getResidencyAllocations()); + csr->flush(batchBuffer, csr->getResidencyAllocations()); EXPECT_EQ(mockGpuAddres, wddm->submitResult.commandBufferSubmitted); memoryManager->freeGraphicsMemory(commandBuffer); } @@ -376,7 +376,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafDisabledWhenFlushIsCalledWithAll ResidencyContainer allocationsForResidency = {linearStreamAllocation}; EXPECT_FALSE(wddm->isKmDafEnabled()); - auto flushStamp = csr->flush(batchBuffer, allocationsForResidency); + csr->flush(batchBuffer, allocationsForResidency); EXPECT_EQ(0u, wddm->kmDafLockResult.called); EXPECT_EQ(0u, wddm->kmDafLockResult.lockedAllocations.size()); @@ -392,7 +392,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithoutA BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs}; wddm->setKmDafEnabled(true); - auto flushStamp = csr->flush(batchBuffer, csr->getResidencyAllocations()); + csr->flush(batchBuffer, csr->getResidencyAllocations()); EXPECT_EQ(0u, wddm->kmDafLockResult.called); EXPECT_EQ(0u, wddm->kmDafLockResult.lockedAllocations.size()); @@ -415,7 +415,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithResi EXPECT_EQ(linearStreamAllocation, csr->getResidencyAllocations()[0]); wddm->setKmDafEnabled(true); - auto flushStamp = csr->flush(batchBuffer, csr->getResidencyAllocations()); + csr->flush(batchBuffer, csr->getResidencyAllocations()); EXPECT_EQ(1u, wddm->kmDafLockResult.called); EXPECT_EQ(1u, wddm->kmDafLockResult.lockedAllocations.size()); @@ -437,7 +437,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithAllo ResidencyContainer allocationsForResidency = {linearStreamAllocation}; wddm->setKmDafEnabled(true); - auto flushStamp = csr->flush(batchBuffer, allocationsForResidency); + csr->flush(batchBuffer, allocationsForResidency); EXPECT_EQ(1u, wddm->kmDafLockResult.called); EXPECT_EQ(1u, wddm->kmDafLockResult.lockedAllocations.size()); @@ -459,7 +459,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithAllo ResidencyContainer allocationsForResidency = {fillPatternAllocation}; wddm->setKmDafEnabled(true); - auto flushStamp = csr->flush(batchBuffer, allocationsForResidency); + csr->flush(batchBuffer, allocationsForResidency); EXPECT_EQ(1u, wddm->kmDafLockResult.called); EXPECT_EQ(1u, wddm->kmDafLockResult.lockedAllocations.size()); @@ -480,7 +480,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithAllo ResidencyContainer allocationsForResidency = {nonLinearStreamAllocation}; wddm->setKmDafEnabled(true); - auto flushStamp = csr->flush(batchBuffer, allocationsForResidency); + csr->flush(batchBuffer, allocationsForResidency); EXPECT_EQ(0u, wddm->kmDafLockResult.called); EXPECT_EQ(0u, wddm->kmDafLockResult.lockedAllocations.size()); @@ -490,8 +490,6 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithAllo } TEST_F(WddmCommandStreamTest, makeResident) { - WddmMemoryManager *wddmMM = reinterpret_cast(memoryManager); - GraphicsAllocation *commandBuffer = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize}); ASSERT_NE(nullptr, commandBuffer); LinearStream cs(commandBuffer); @@ -506,8 +504,6 @@ TEST_F(WddmCommandStreamTest, makeResident) { } TEST_F(WddmCommandStreamTest, makeNonResidentPutsAllocationInEvictionAllocations) { - WddmMemoryManager *wddmMM = reinterpret_cast(memoryManager); - GraphicsAllocation *commandBuffer = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize}); ASSERT_NE(nullptr, commandBuffer); LinearStream cs(commandBuffer); @@ -522,8 +518,6 @@ TEST_F(WddmCommandStreamTest, makeNonResidentPutsAllocationInEvictionAllocations } TEST_F(WddmCommandStreamTest, processEvictionPlacesAllAllocationsOnTrimCandidateList) { - WddmMemoryManager *wddmMM = reinterpret_cast(memoryManager); - GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize}); GraphicsAllocation *allocation2 = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize}); ASSERT_NE(nullptr, allocation); @@ -543,8 +537,6 @@ TEST_F(WddmCommandStreamTest, processEvictionPlacesAllAllocationsOnTrimCandidate } TEST_F(WddmCommandStreamTest, processEvictionClearsEvictionAllocations) { - WddmMemoryManager *wddmMM = reinterpret_cast(memoryManager); - GraphicsAllocation *allocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize}); ASSERT_NE(nullptr, allocation); @@ -562,7 +554,6 @@ TEST_F(WddmCommandStreamTest, processEvictionClearsEvictionAllocations) { TEST_F(WddmCommandStreamTest, makeResidentNonResidentMemObj) { GraphicsAllocation *gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize}); Buffer *buffer = new AlignedBuffer(gfxAllocation); - WddmMemoryManager *wddmMM = reinterpret_cast(memoryManager); csr->makeResident(*buffer->getGraphicsAllocation()); EXPECT_EQ(0u, wddm->makeResidentResult.called); @@ -888,7 +879,7 @@ HWTEST_F(WddmCsrCompressionTests, givenEnabledCompressionWhenFlushingThenInitTra auto memoryManager = executionEnvironment->memoryManager.get(); - auto &csrCS = mockWddmCsr->getCS(); + mockWddmCsr->getCS(); auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize}); IndirectHeap cs(graphicsAllocation); diff --git a/unit_tests/os_interface/windows/gl/gl_os_sharing_tests.cpp b/unit_tests/os_interface/windows/gl/gl_os_sharing_tests.cpp index c9468e67fd..0dc7ff4e98 100644 --- a/unit_tests/os_interface/windows/gl/gl_os_sharing_tests.cpp +++ b/unit_tests/os_interface/windows/gl/gl_os_sharing_tests.cpp @@ -137,6 +137,7 @@ TEST_F(GlArbSyncEventOsTest, WhenCreateSynchronizationObjectSucceedsThenAllHAndl gdi->createSynchronizationObject.mFunc = CreateSyncObjectMock::createSynchObject; gdi->createSynchronizationObject2.mFunc = CreateSyncObjectMock::createSynchObject2; auto ret = setupArbSyncObject(sharing, osInterface, syncInfo); + EXPECT_TRUE(ret); EXPECT_EQ(1U, syncInfo.serverSynchronizationObject); EXPECT_EQ(2U, syncInfo.clientSynchronizationObject); EXPECT_EQ(3U, syncInfo.submissionSynchronizationObject); diff --git a/unit_tests/os_interface/windows/wddm20_tests.cpp b/unit_tests/os_interface/windows/wddm20_tests.cpp index a6276452c6..d7d4cec21e 100644 --- a/unit_tests/os_interface/windows/wddm20_tests.cpp +++ b/unit_tests/os_interface/windows/wddm20_tests.cpp @@ -224,6 +224,7 @@ TEST_F(Wddm20WithMockGdiDllTests, givenWddmAllocationWhenMappingGpuVaThenUseGmmS allocation.gmm = gmm.get(); auto status = wddm->createAllocation(&allocation); + EXPECT_EQ(STATUS_SUCCESS, status); auto mockResourceInfo = static_cast(gmm->gmmResourceInfo.get()); mockResourceInfo->overrideReturnedSize(allocation.getAlignedSize() + (2 * MemoryConstants::pageSize)); @@ -646,8 +647,6 @@ TEST_F(Wddm20Tests, givenDestroyAllocationWhenItIsCalledThenAllocationIsPassedTo *osContextWin->getResidencyController().getMonitoredFence().cpuAddress = 10; - D3DKMT_HANDLE handle = (D3DKMT_HANDLE)0x1234; - gdi->getWaitFromCpuArg().FenceValueArray = nullptr; gdi->getWaitFromCpuArg().Flags.Value = 0; gdi->getWaitFromCpuArg().hDevice = (D3DKMT_HANDLE)0; diff --git a/unit_tests/os_interface/windows/wddm_memory_manager_tests.cpp b/unit_tests/os_interface/windows/wddm_memory_manager_tests.cpp index 92f8259ceb..ed408a2a53 100644 --- a/unit_tests/os_interface/windows/wddm_memory_manager_tests.cpp +++ b/unit_tests/os_interface/windows/wddm_memory_manager_tests.cpp @@ -313,11 +313,10 @@ TEST_F(WddmMemoryManagerTest, givenDefaultMemoryManagerWhenAllocateWithSizeIsCal TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenCreateFromSharedHandleIsCalledThenNonNullGraphicsAllocationIsReturned) { auto osHandle = 1u; - auto size = 4096u; void *pSysMem = reinterpret_cast(0x1000); std::unique_ptr gmm(new Gmm(pSysMem, 4096u, false)); - auto status = setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); + setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, false); auto wddmAlloc = static_cast(gpuAllocation); @@ -329,11 +328,10 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenCreateFromSharedHandleIs } TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenCreateFromNTHandleIsCalledThenNonNullGraphicsAllocationIsReturned) { - auto size = 4096u; void *pSysMem = reinterpret_cast(0x1000); std::unique_ptr gmm(new Gmm(pSysMem, 4096u, false)); - auto status = setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); + setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); auto *gpuAllocation = memoryManager->createGraphicsAllocationFromNTHandle(reinterpret_cast(1)); auto wddmAlloc = static_cast(gpuAllocation); @@ -361,11 +359,10 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenLockUnlockIsCalledThenRe TEST_F(WddmMemoryManagerTest, createAllocationFromSharedHandleReturns32BitAllocWhenForce32bitAddressingIsSetAndRequireSpecificBitnessIsTrue) { auto osHandle = 1u; - auto size = 4096u; void *pSysMem = reinterpret_cast(0x1000); std::unique_ptr gmm(new Gmm(pSysMem, 4096u, false)); - auto status = setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); + setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); memoryManager->setForce32BitAllocations(true); @@ -383,11 +380,10 @@ TEST_F(WddmMemoryManagerTest, createAllocationFromSharedHandleReturns32BitAllocW TEST_F(WddmMemoryManagerTest, createAllocationFromSharedHandleDoesNotReturn32BitAllocWhenForce32bitAddressingIsSetAndRequireSpecificBitnessIsFalse) { auto osHandle = 1u; - auto size = 4096u; void *pSysMem = reinterpret_cast(0x1000); std::unique_ptr gmm(new Gmm(pSysMem, 4096u, false)); - auto status = setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); + setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); memoryManager->setForce32BitAllocations(true); @@ -405,11 +401,10 @@ TEST_F(WddmMemoryManagerTest, createAllocationFromSharedHandleDoesNotReturn32Bit TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenFreeAllocFromSharedHandleIsCalledThenDestroyResourceHandle) { auto osHandle = 1u; - auto size = 4096u; void *pSysMem = reinterpret_cast(0x1000); std::unique_ptr gmm(new Gmm(pSysMem, 4096u, false)); - auto status = setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); + setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); auto gpuAllocation = (WddmAllocation *)memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, false); EXPECT_NE(nullptr, gpuAllocation); @@ -430,7 +425,7 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerSizeZeroWhenCreateFromShared void *pSysMem = reinterpret_cast(0x1000); std::unique_ptr gmm(new Gmm(pSysMem, size, false)); - auto status = setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); + setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); auto *gpuAllocation = memoryManager->createGraphicsAllocationFromSharedHandle(osHandle, false); ASSERT_NE(nullptr, gpuAllocation); @@ -444,7 +439,7 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenCreateFromSharedHandleFa void *pSysMem = reinterpret_cast(0x1000); std::unique_ptr gmm(new Gmm(pSysMem, size, false)); - auto status = setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); + setSizesFcn(gmm->gmmResourceInfo.get(), 1u, 1024u, 1u); wddm->failOpenSharedHandle = true; @@ -597,7 +592,6 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenNonTiledImgWithMipCountN TEST_F(WddmMemoryManagerTest, AllocateGpuMemHostPtrOffseted) { MockWddmAllocation alloc, allocOffseted; - bool success = false; // three pages void *ptr = alignedMalloc(4 * 4096, 4096); ASSERT_NE(nullptr, ptr); @@ -651,7 +645,6 @@ TEST_F(WddmMemoryManagerTest, AllocateGpuMemHostPtrOffseted) { TEST_F(WddmMemoryManagerTest, AllocateGpuMemCheckGmm) { MockWddmAllocation allocation; - bool success = false; // three pages void *ptr = alignedMalloc(3 * 4096, 4096); auto *gpuAllocation = memoryManager->allocateGraphicsMemory(MockAllocationProperties{false, 3 * MemoryConstants::pageSize}, ptr); @@ -669,9 +662,7 @@ TEST_F(WddmMemoryManagerTest, AllocateGpuMemCheckGmm) { } TEST_F(WddmMemoryManagerTest, GivenAlignedPointerWhenAllocate32BitMemoryThenGmmCalledWithCorrectPointerAndSize) { - MockWddmAllocation allocation; - bool success = false; uint32_t size = 4096; void *ptr = reinterpret_cast(4096); auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(size, ptr, AllocationOrigin::EXTERNAL_ALLOCATION); @@ -682,7 +673,6 @@ TEST_F(WddmMemoryManagerTest, GivenAlignedPointerWhenAllocate32BitMemoryThenGmmC TEST_F(WddmMemoryManagerTest, GivenUnAlignedPointerAndSizeWhenAllocate32BitMemoryThenGmmCalledWithCorrectPointerAndSize) { MockWddmAllocation allocation; - bool success = false; uint32_t size = 0x1001; void *ptr = reinterpret_cast(0x1001); auto *gpuAllocation = memoryManager->allocate32BitGraphicsMemory(size, ptr, AllocationOrigin::EXTERNAL_ALLOCATION); @@ -955,9 +945,6 @@ TEST_F(BufferWithWddmMemory, GivenMisalignedHostPtrAndMultiplePagesSizeWhenAsked auto reqs = MockHostPtrManager::getAllocationRequirements(ptr, size); for (int i = 0; i < maxFragmentsCount; i++) { - - uintptr_t GpuPtr = (uintptr_t)(graphicsAllocation->fragmentsStorage.fragmentStorageData[i].osHandleStorage->gpuPtr); - uintptr_t CpuPtr = (uintptr_t)(reqs.AllocationFragments[i].allocationPtr); EXPECT_NE((D3DKMT_HANDLE) nullptr, graphicsAllocation->fragmentsStorage.fragmentStorageData[i].osHandleStorage->handle); EXPECT_NE(nullptr, graphicsAllocation->fragmentsStorage.fragmentStorageData[i].osHandleStorage->gmm); @@ -1519,4 +1506,4 @@ TEST_F(WddmMemoryManagerSimpleTest, whenDestroyingNotLockedAllocationThatNeedsMa EXPECT_FALSE(allocation->isLocked()); memoryManager->freeGraphicsMemory(allocation); EXPECT_EQ(0u, wddm->evictTemporaryResourceResult.called); -} \ No newline at end of file +} diff --git a/unit_tests/os_interface/windows/wddm_residency_controller_tests.cpp b/unit_tests/os_interface/windows/wddm_residency_controller_tests.cpp index 0dbcd72353..2ab4deb4f7 100644 --- a/unit_tests/os_interface/windows/wddm_residency_controller_tests.cpp +++ b/unit_tests/os_interface/windows/wddm_residency_controller_tests.cpp @@ -364,8 +364,8 @@ TEST_F(WddmResidencyControllerTest, compactTrimCandidateListRemovesInitialNullEn residencyController->addToTrimCandidateList(&allocation3); residencyController->addToTrimCandidateList(&allocation4); - size_t position3 = allocation3.getTrimCandidateListPosition(osContextId); - size_t position4 = allocation4.getTrimCandidateListPosition(osContextId); + allocation3.getTrimCandidateListPosition(osContextId); + allocation4.getTrimCandidateListPosition(osContextId); residencyController->removeFromTrimCandidateList(&allocation2, false); residencyController->removeFromTrimCandidateList(&allocation1, false); @@ -687,7 +687,7 @@ TEST_F(WddmResidencyControllerWithGdiTest, trimToBudgetMarksEvictedAllocationNon residencyController->addToTrimCandidateList(&allocation2); residencyController->addToTrimCandidateList(&allocation3); - bool status = residencyController->trimResidencyToBudget(3 * 4096); + residencyController->trimResidencyToBudget(3 * 4096); EXPECT_FALSE(allocation1.getResidencyData().resident[osContextId]); EXPECT_FALSE(allocation2.getResidencyData().resident[osContextId]); @@ -713,7 +713,7 @@ TEST_F(WddmResidencyControllerWithGdiTest, trimToBudgetWaitsFromCpuWhenLastFence gdi->getWaitFromCpuArg().hDevice = (D3DKMT_HANDLE)0; - bool status = residencyController->trimResidencyToBudget(3 * 4096); + residencyController->trimResidencyToBudget(3 * 4096); EXPECT_EQ(1u, wddm->makeNonResidentResult.called); EXPECT_FALSE(allocation1.getResidencyData().resident[osContextId]); @@ -759,7 +759,7 @@ TEST_F(WddmResidencyControllerWithGdiAndMemoryManagerTest, trimToBudgetEvictsDon wddm->makeNonResidentResult.called = 0; - bool status = residencyController->trimResidencyToBudget(3 * 4096); + residencyController->trimResidencyToBudget(3 * 4096); EXPECT_EQ(2u, wddm->makeNonResidentResult.called); @@ -1012,6 +1012,6 @@ TEST_F(WddmResidencyControllerWithMockWddmTest, givenMakeResidentFailsWhenCallin EXPECT_CALL(*wddm, makeResident(::testing::_, ::testing::_, ::testing::_, ::testing::_)).Times(2).WillOnce(::testing::Invoke(makeResidentThatFails)).WillOnce(::testing::Invoke(makeResidentThatSucceds)); - bool result = residencyController->makeResidentResidencyAllocations(residencyPack); + residencyController->makeResidentResidencyAllocations(residencyPack); EXPECT_TRUE(residencyController->isMemoryBudgetExhausted()); }