diff --git a/runtime/helpers/mipmap.cpp b/runtime/helpers/mipmap.cpp index bd02d3b276..1d48a5f8c6 100644 --- a/runtime/helpers/mipmap.cpp +++ b/runtime/helpers/mipmap.cpp @@ -27,6 +27,7 @@ #include "runtime/mem_obj/image.h" #include +#include namespace OCLRT { @@ -44,7 +45,7 @@ uint32_t getMipLevelOriginIdx(cl_mem_object_type imageType) { return 0; default: DEBUG_BREAK_IF(true); - return -1; + return std::numeric_limits::max(); } } diff --git a/runtime/os_interface/windows/os_time_win.cpp b/runtime/os_interface/windows/os_time_win.cpp index 27e22f377a..eafcb6b4fe 100644 --- a/runtime/os_interface/windows/os_time_win.cpp +++ b/runtime/os_interface/windows/os_time_win.cpp @@ -34,8 +34,6 @@ bool runEscape(Wddm *wddm, TimeStampDataHeader &escapeInfo) { D3DKMT_ESCAPE escapeCommand = {0}; GTDIGetGpuCpuTimestampsIn in = {GTDI_FNC_GET_GPU_CPU_TIMESTAMPS}; - GTDIGetGpuCpuTimestampsOut out = {GTDI_RET_FAILED, 0}; - uint32_t inSize = sizeof(GTDIGetGpuCpuTimestampsIn); uint32_t outSize = sizeof(GTDIGetGpuCpuTimestampsOut); escapeInfo.m_Header.EscapeCode = GFX_ESCAPE_IGPA_INSTRUMENTATION_CONTROL; @@ -92,7 +90,7 @@ std::unique_ptr OSTime::create(OSInterface *osInterface) { return std::unique_ptr(new OSTimeWin(osInterface)); } -OSTimeWin::OSTimeWin(OSInterface *osInterface) : wddm(nullptr) { +OSTimeWin::OSTimeWin(OSInterface *osInterface) { this->osInterface = osInterface; if (osInterface) { wddm = osInterface->get()->getWddm(); diff --git a/runtime/os_interface/windows/os_time_win.h b/runtime/os_interface/windows/os_time_win.h index 53a6655b4b..4c1c86654d 100644 --- a/runtime/os_interface/windows/os_time_win.h +++ b/runtime/os_interface/windows/os_time_win.h @@ -39,9 +39,9 @@ class OSTimeWin : public OSTime { uint64_t getCpuRawTimestamp() override; protected: - Wddm *wddm; + Wddm *wddm = nullptr; LARGE_INTEGER frequency; - OSTimeWin() {} + OSTimeWin() = default; decltype(&QueryPerformanceCounter) QueryPerfomanceCounterFnc = QueryPerformanceCounter; }; diff --git a/runtime/os_interface/windows/print.cpp b/runtime/os_interface/windows/print.cpp index 2b561c938f..c409b18b3f 100644 --- a/runtime/os_interface/windows/print.cpp +++ b/runtime/os_interface/windows/print.cpp @@ -30,7 +30,6 @@ #include void printToSTDOUT(const char *str) { - int bytesRead = 0; int fd = 0; HANDLE stdoutDuplicate = 0; FILE *pFile = nullptr; diff --git a/runtime/os_interface/windows/wddm_memory_manager.cpp b/runtime/os_interface/windows/wddm_memory_manager.cpp index bb6a48ee2d..0463615fa9 100644 --- a/runtime/os_interface/windows/wddm_memory_manager.cpp +++ b/runtime/os_interface/windows/wddm_memory_manager.cpp @@ -645,8 +645,6 @@ void WddmMemoryManager::trimResidency(D3DDDI_TRIMRESIDENCYSET_FLAGS flags, uint6 acquireResidencyLock(); - size_t size = trimCandidateList.size(); - WddmAllocation *wddmAllocation = nullptr; while ((wddmAllocation = getTrimCandidateHead()) != nullptr) { @@ -657,7 +655,6 @@ void WddmMemoryManager::trimResidency(D3DDDI_TRIMRESIDENCYSET_FLAGS flags, uint6 DBG_LOG(ResidencyDebugEnable, "Residency:", __FUNCTION__, "allocation: handle =", wddmAllocation->handle, "lastFence =", (wddmAllocation)->getResidencyData().lastFence); - size_t fragmentsSizeToEvict = 0; uint32_t fragmentsToEvict = 0; if (wddmAllocation->fragmentsStorage.fragmentCount == 0) { diff --git a/runtime/utilities/windows/timer_util.cpp b/runtime/utilities/windows/timer_util.cpp index 9103711240..058baf64b1 100644 --- a/runtime/utilities/windows/timer_util.cpp +++ b/runtime/utilities/windows/timer_util.cpp @@ -47,7 +47,6 @@ class Timer::TimerImpl { } long long int get() { - long long int nanosecondTime = 0; auto timeDelta = (double)(m_endTime.QuadPart - m_startTime.QuadPart); timeDelta /= (double)mFrequency.QuadPart; timeDelta *= 1000000000.0;