diff --git a/level_zero/core/test/unit_tests/sources/debugger/windows/test_l0_debugger_windows.cpp b/level_zero/core/test/unit_tests/sources/debugger/windows/test_l0_debugger_windows.cpp index d6995d124f..aa64e5d188 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/windows/test_l0_debugger_windows.cpp +++ b/level_zero/core/test/unit_tests/sources/debugger/windows/test_l0_debugger_windows.cpp @@ -143,7 +143,7 @@ TEST_F(L0DebuggerWindowsTest, givenDebuggerL0NotifyModuleCreateCalledAndCreateDe debugger->notifyModuleCreate((void *)0x12345678, 0x1000, 0x80000000); EXPECT_EQ(1u, wddm->createDebugDataCalled); EXPECT_EQ(0xDEADDEADu, wddm->createDebugDataPassedParam.param.hElfAddressPtr); - EXPECT_EQ(0, wddm->moduleCreateNotifyCalled); + EXPECT_EQ(0u, wddm->moduleCreateNotifyCalled); } TEST_F(L0DebuggerWindowsTest, givenDebuggerL0NotifyModuleCreateCalledAndModuleCreateNotifyEscapeIsFailedThenModuleIsNotRegistered) { @@ -161,12 +161,12 @@ TEST_F(L0DebuggerWindowsTest, givenDebuggerL0NotifyModuleCreateCalledThenCreateD debugger->notifyModuleCreate((void *)0x12345678, 0x1000, 0x80000000); EXPECT_EQ(1u, wddm->createDebugDataCalled); EXPECT_EQ(ELF_BINARY, wddm->createDebugDataPassedParam.param.DebugDataType); - EXPECT_EQ(0x1000, wddm->createDebugDataPassedParam.param.DataSize); + EXPECT_EQ(0x1000u, wddm->createDebugDataPassedParam.param.DataSize); EXPECT_EQ(0x12345678u, wddm->createDebugDataPassedParam.param.hElfAddressPtr); EXPECT_EQ(1u, wddm->moduleCreateNotifyCalled); EXPECT_TRUE(wddm->moduleCreateNotificationPassedParam.param.IsCreate); - EXPECT_EQ(0x1000, wddm->moduleCreateNotificationPassedParam.param.Modulesize); + EXPECT_EQ(0x1000u, wddm->moduleCreateNotificationPassedParam.param.Modulesize); EXPECT_EQ(0x12345678u, wddm->moduleCreateNotificationPassedParam.param.hElfAddressPtr); EXPECT_EQ(0x80000000, wddm->moduleCreateNotificationPassedParam.param.LoadAddress); } @@ -179,7 +179,7 @@ TEST_F(L0DebuggerWindowsTest, givenDebuggerL0NotifyModuleDestroyCalledThenModule EXPECT_FALSE(wddm->moduleCreateNotificationPassedParam.param.IsCreate); EXPECT_EQ(0u, wddm->moduleCreateNotificationPassedParam.param.Modulesize); EXPECT_EQ(0ull, wddm->moduleCreateNotificationPassedParam.param.hElfAddressPtr); - EXPECT_EQ(0x80000000, wddm->moduleCreateNotificationPassedParam.param.LoadAddress); + EXPECT_EQ(0x80000000u, wddm->moduleCreateNotificationPassedParam.param.LoadAddress); } TEST_F(L0DebuggerWindowsTest, givenDebuggerL0NotifyModuleDestroyCalledAndModuleDestroyNotifyEscapeIsFailedThenErrorMessageIsPrinted) { diff --git a/opencl/source/api/api.cpp b/opencl/source/api/api.cpp index c5c66fe777..e04d6414f1 100644 --- a/opencl/source/api/api.cpp +++ b/opencl/source/api/api.cpp @@ -415,7 +415,7 @@ cl_context CL_API_CALL clCreateContext(const cl_context_properties *properties, cl_int retVal = CL_SUCCESS; cl_context context = nullptr; API_ENTER(&retVal); - DBG_LOG_INPUTS("properties", properties, "numDevices", numDevices, "cl_device_id", devices, "funcNotify", funcNotify, "userData", userData); + DBG_LOG_INPUTS("properties", properties, "numDevices", numDevices, "cl_device_id", devices, "funcNotify", reinterpret_cast(funcNotify), "userData", userData); do { if (devices == nullptr) { @@ -471,7 +471,7 @@ cl_context CL_API_CALL clCreateContextFromType(const cl_context_properties *prop TRACING_ENTER(ClCreateContextFromType, &properties, &deviceType, &funcNotify, &userData, &errcodeRet); cl_int retVal = CL_SUCCESS; API_ENTER(&retVal); - DBG_LOG_INPUTS("properties", properties, "deviceType", deviceType, "funcNotify", funcNotify, "userData", userData); + DBG_LOG_INPUTS("properties", properties, "deviceType", deviceType, "funcNotify", reinterpret_cast(funcNotify), "userData", userData); cl_context context = nullptr; do { @@ -1264,7 +1264,7 @@ cl_int CL_API_CALL clSetMemObjectDestructorCallback(cl_mem memobj, TRACING_ENTER(ClSetMemObjectDestructorCallback, &memobj, &funcNotify, &userData); cl_int retVal = CL_SUCCESS; API_ENTER(&retVal); - DBG_LOG_INPUTS("memobj", memobj, "funcNotify", funcNotify, "userData", userData); + DBG_LOG_INPUTS("memobj", memobj, "funcNotify", reinterpret_cast(funcNotify), "userData", userData); retVal = validateObjects(memobj, (void *)funcNotify); if (CL_SUCCESS != retVal) { @@ -1577,7 +1577,7 @@ cl_int CL_API_CALL clBuildProgram(cl_program program, TRACING_ENTER(ClBuildProgram, &program, &numDevices, &deviceList, &options, &funcNotify, &userData); cl_int retVal = CL_INVALID_PROGRAM; API_ENTER(&retVal); - DBG_LOG_INPUTS("clProgram", program, "numDevices", numDevices, "cl_device_id", deviceList, "options", (options != nullptr) ? options : "", "funcNotify", funcNotify, "userData", userData); + DBG_LOG_INPUTS("clProgram", program, "numDevices", numDevices, "cl_device_id", deviceList, "options", (options != nullptr) ? options : "", "funcNotify", reinterpret_cast(funcNotify), "userData", userData); Program *pProgram = nullptr; retVal = validateObjects(withCastToInternal(program, &pProgram), Program::isValidCallback(funcNotify, userData)); @@ -3630,7 +3630,7 @@ cl_int CL_API_CALL clEnqueueNativeKernel(cl_command_queue commandQueue, TRACING_ENTER(ClEnqueueNativeKernel, &commandQueue, &userFunc, &args, &cbArgs, &numMemObjects, &memList, &argsMemLoc, &numEventsInWaitList, &eventWaitList, &event); cl_int retVal = CL_OUT_OF_HOST_MEMORY; API_ENTER(&retVal); - DBG_LOG_INPUTS("commandQueue", commandQueue, "userFunc", userFunc, "args", args, + DBG_LOG_INPUTS("commandQueue", commandQueue, "userFunc", reinterpret_cast(userFunc), "args", args, "cbArgs", cbArgs, "numMemObjects", numMemObjects, "memList", memList, "argsMemLoc", argsMemLoc, "numEventsInWaitList", numEventsInWaitList, "eventWaitList", getClFileLogger().getEvents(reinterpret_cast(eventWaitList), numEventsInWaitList), @@ -4669,7 +4669,7 @@ cl_int CL_API_CALL clEnqueueSVMFree(cl_command_queue commandQueue, DBG_LOG_INPUTS("commandQueue", commandQueue, "numSvmPointers", numSvmPointers, "svmPointers", svmPointers, - "pfnFreeFunc", pfnFreeFunc, + "pfnFreeFunc", reinterpret_cast(pfnFreeFunc), "userData", userData, "numEventsInWaitList", numEventsInWaitList, "eventWaitList", getClFileLogger().getEvents(reinterpret_cast(eventWaitList), numEventsInWaitList), @@ -5901,7 +5901,7 @@ cl_int CL_API_CALL clSetProgramReleaseCallback(cl_program program, void(CL_CALLBACK *pfnNotify)(cl_program /* program */, void * /* user_data */), void *userData) { DBG_LOG_INPUTS("program", program, - "pfnNotify", pfnNotify, + "pfnNotify", reinterpret_cast(pfnNotify), "userData", userData); cl_int retVal = CL_SUCCESS; @@ -6143,7 +6143,7 @@ cl_int CL_API_CALL clSetContextDestructorCallback(cl_context context, void(CL_CALLBACK *pfnNotify)(cl_context /* context */, void * /* user_data */), void *userData) { DBG_LOG_INPUTS("program", context, - "pfnNotify", pfnNotify, + "pfnNotify", reinterpret_cast(pfnNotify), "userData", userData); cl_int retVal = CL_SUCCESS; diff --git a/opencl/source/api/dispatch.h b/opencl/source/api/dispatch.h index 0b0b9e0f91..cc3177e209 100644 --- a/opencl/source/api/dispatch.h +++ b/opencl/source/api/dispatch.h @@ -11,6 +11,14 @@ #include "CL/cl_ext.h" #include "CL/cl_gl.h" #if defined(_WIN32) +#if __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wignored-pragma-intrinsic" +#pragma clang diagnostic ignored "-Wpragma-pack" +#pragma clang diagnostic ignored "-Wignored-attributes" +#pragma clang diagnostic ignored "-Wmacro-redefined" +#pragma clang diagnostic ignored "-Wcomment" +#endif #include #include "CL/cl_d3d10.h" @@ -20,6 +28,10 @@ #include "shared/source/os_interface/windows/windows_wrapper.h" #include "CL/cl_dx9_media_sharing.h" + +#if __clang__ +#pragma clang diagnostic pop +#endif #else #define CL_CONTEXT_D3D10_DEVICE_KHR 0x4014 #define CL_CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR 0x402C diff --git a/opencl/source/os_interface/windows/d3d10_11_sharing_functions.cpp b/opencl/source/os_interface/windows/d3d10_11_sharing_functions.cpp index 8c287e1542..d56a1bdd5f 100644 --- a/opencl/source/os_interface/windows/d3d10_11_sharing_functions.cpp +++ b/opencl/source/os_interface/windows/d3d10_11_sharing_functions.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -11,134 +11,18 @@ #include "opencl/source/sharings/d3d/d3d_sharing.h" #include "opencl/source/sharings/sharing_factory.h" -#include "DXGI1_2.h" +#include "dxgi1_2.h" using namespace NEO; -template class D3DSharingFunctions; -template class D3DSharingFunctions; +template class NEO::D3DSharingFunctions; +template class NEO::D3DSharingFunctions; +template <> const uint32_t D3DSharingFunctions::sharingId = SharingType::D3D10_SHARING; +template <> const uint32_t D3DSharingFunctions::sharingId = SharingType::D3D11_SHARING; -static const DXGI_FORMAT DXGIFormats[] = { - DXGI_FORMAT_R32G32B32A32_TYPELESS, - DXGI_FORMAT_R32G32B32A32_FLOAT, - DXGI_FORMAT_R32G32B32A32_UINT, - DXGI_FORMAT_R32G32B32A32_SINT, - DXGI_FORMAT_R32G32B32_TYPELESS, - DXGI_FORMAT_R32G32B32_FLOAT, - DXGI_FORMAT_R32G32B32_UINT, - DXGI_FORMAT_R32G32B32_SINT, - DXGI_FORMAT_R16G16B16A16_TYPELESS, - DXGI_FORMAT_R16G16B16A16_FLOAT, - DXGI_FORMAT_R16G16B16A16_UNORM, - DXGI_FORMAT_R16G16B16A16_UINT, - DXGI_FORMAT_R16G16B16A16_SNORM, - DXGI_FORMAT_R16G16B16A16_SINT, - DXGI_FORMAT_R32G32_TYPELESS, - DXGI_FORMAT_R32G32_FLOAT, - DXGI_FORMAT_R32G32_UINT, - DXGI_FORMAT_R32G32_SINT, - DXGI_FORMAT_R32G8X24_TYPELESS, - DXGI_FORMAT_D32_FLOAT_S8X24_UINT, - DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS, - DXGI_FORMAT_X32_TYPELESS_G8X24_UINT, - DXGI_FORMAT_R10G10B10A2_TYPELESS, - DXGI_FORMAT_R10G10B10A2_UNORM, - DXGI_FORMAT_R10G10B10A2_UINT, - DXGI_FORMAT_R11G11B10_FLOAT, - DXGI_FORMAT_R8G8B8A8_TYPELESS, - DXGI_FORMAT_R8G8B8A8_UNORM, - DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, - DXGI_FORMAT_R8G8B8A8_UINT, - DXGI_FORMAT_R8G8B8A8_SNORM, - DXGI_FORMAT_R8G8B8A8_SINT, - DXGI_FORMAT_R16G16_TYPELESS, - DXGI_FORMAT_R16G16_FLOAT, - DXGI_FORMAT_R16G16_UNORM, - DXGI_FORMAT_R16G16_UINT, - DXGI_FORMAT_R16G16_SNORM, - DXGI_FORMAT_R16G16_SINT, - DXGI_FORMAT_R32_TYPELESS, - DXGI_FORMAT_D32_FLOAT, - DXGI_FORMAT_R32_FLOAT, - DXGI_FORMAT_R32_UINT, - DXGI_FORMAT_R32_SINT, - DXGI_FORMAT_R24G8_TYPELESS, - DXGI_FORMAT_D24_UNORM_S8_UINT, - DXGI_FORMAT_R24_UNORM_X8_TYPELESS, - DXGI_FORMAT_X24_TYPELESS_G8_UINT, - DXGI_FORMAT_R8G8_TYPELESS, - DXGI_FORMAT_R8G8_UNORM, - DXGI_FORMAT_R8G8_UINT, - DXGI_FORMAT_R8G8_SNORM, - DXGI_FORMAT_R8G8_SINT, - DXGI_FORMAT_R16_TYPELESS, - DXGI_FORMAT_R16_FLOAT, - DXGI_FORMAT_D16_UNORM, - DXGI_FORMAT_R16_UNORM, - DXGI_FORMAT_R16_UINT, - DXGI_FORMAT_R16_SNORM, - DXGI_FORMAT_R16_SINT, - DXGI_FORMAT_R8_TYPELESS, - DXGI_FORMAT_R8_UNORM, - DXGI_FORMAT_R8_UINT, - DXGI_FORMAT_R8_SNORM, - DXGI_FORMAT_R8_SINT, - DXGI_FORMAT_A8_UNORM, - DXGI_FORMAT_R1_UNORM, - DXGI_FORMAT_R9G9B9E5_SHAREDEXP, - DXGI_FORMAT_R8G8_B8G8_UNORM, - DXGI_FORMAT_G8R8_G8B8_UNORM, - DXGI_FORMAT_BC1_TYPELESS, - DXGI_FORMAT_BC1_UNORM, - DXGI_FORMAT_BC1_UNORM_SRGB, - DXGI_FORMAT_BC2_TYPELESS, - DXGI_FORMAT_BC2_UNORM, - DXGI_FORMAT_BC2_UNORM_SRGB, - DXGI_FORMAT_BC3_TYPELESS, - DXGI_FORMAT_BC3_UNORM, - DXGI_FORMAT_BC3_UNORM_SRGB, - DXGI_FORMAT_BC4_TYPELESS, - DXGI_FORMAT_BC4_UNORM, - DXGI_FORMAT_BC4_SNORM, - DXGI_FORMAT_BC5_TYPELESS, - DXGI_FORMAT_BC5_UNORM, - DXGI_FORMAT_BC5_SNORM, - DXGI_FORMAT_B5G6R5_UNORM, - DXGI_FORMAT_B5G5R5A1_UNORM, - DXGI_FORMAT_B8G8R8A8_UNORM, - DXGI_FORMAT_B8G8R8X8_UNORM, - DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM, - DXGI_FORMAT_B8G8R8A8_TYPELESS, - DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, - DXGI_FORMAT_B8G8R8X8_TYPELESS, - DXGI_FORMAT_B8G8R8X8_UNORM_SRGB, - DXGI_FORMAT_BC6H_TYPELESS, - DXGI_FORMAT_BC6H_UF16, - DXGI_FORMAT_BC6H_SF16, - DXGI_FORMAT_BC7_TYPELESS, - DXGI_FORMAT_BC7_UNORM, - DXGI_FORMAT_BC7_UNORM_SRGB, - DXGI_FORMAT_AYUV, - DXGI_FORMAT_Y410, - DXGI_FORMAT_Y416, - DXGI_FORMAT_NV12, - DXGI_FORMAT_P010, - DXGI_FORMAT_P016, - DXGI_FORMAT_YUY2, - DXGI_FORMAT_Y210, - DXGI_FORMAT_Y216, - DXGI_FORMAT_AI44, - DXGI_FORMAT_IA44, - DXGI_FORMAT_P8, - DXGI_FORMAT_A8P8, - DXGI_FORMAT_B4G4R4A4_UNORM, - DXGI_FORMAT_V208, - DXGI_FORMAT_V408, - DXGI_FORMAT_FORCE_UINT}; - template void D3DSharingFunctions::createQuery(D3DQuery **query) { D3DQueryDesc desc = {}; @@ -240,6 +124,123 @@ std::vector &D3DSharingFunctions::retrieveTextureFormats(cl_me std::vector &cached_formats = cached->second; std::vector planarFormats(0); + constexpr DXGI_FORMAT DXGIFormats[] = { + DXGI_FORMAT_R32G32B32A32_TYPELESS, + DXGI_FORMAT_R32G32B32A32_FLOAT, + DXGI_FORMAT_R32G32B32A32_UINT, + DXGI_FORMAT_R32G32B32A32_SINT, + DXGI_FORMAT_R32G32B32_TYPELESS, + DXGI_FORMAT_R32G32B32_FLOAT, + DXGI_FORMAT_R32G32B32_UINT, + DXGI_FORMAT_R32G32B32_SINT, + DXGI_FORMAT_R16G16B16A16_TYPELESS, + DXGI_FORMAT_R16G16B16A16_FLOAT, + DXGI_FORMAT_R16G16B16A16_UNORM, + DXGI_FORMAT_R16G16B16A16_UINT, + DXGI_FORMAT_R16G16B16A16_SNORM, + DXGI_FORMAT_R16G16B16A16_SINT, + DXGI_FORMAT_R32G32_TYPELESS, + DXGI_FORMAT_R32G32_FLOAT, + DXGI_FORMAT_R32G32_UINT, + DXGI_FORMAT_R32G32_SINT, + DXGI_FORMAT_R32G8X24_TYPELESS, + DXGI_FORMAT_D32_FLOAT_S8X24_UINT, + DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS, + DXGI_FORMAT_X32_TYPELESS_G8X24_UINT, + DXGI_FORMAT_R10G10B10A2_TYPELESS, + DXGI_FORMAT_R10G10B10A2_UNORM, + DXGI_FORMAT_R10G10B10A2_UINT, + DXGI_FORMAT_R11G11B10_FLOAT, + DXGI_FORMAT_R8G8B8A8_TYPELESS, + DXGI_FORMAT_R8G8B8A8_UNORM, + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, + DXGI_FORMAT_R8G8B8A8_UINT, + DXGI_FORMAT_R8G8B8A8_SNORM, + DXGI_FORMAT_R8G8B8A8_SINT, + DXGI_FORMAT_R16G16_TYPELESS, + DXGI_FORMAT_R16G16_FLOAT, + DXGI_FORMAT_R16G16_UNORM, + DXGI_FORMAT_R16G16_UINT, + DXGI_FORMAT_R16G16_SNORM, + DXGI_FORMAT_R16G16_SINT, + DXGI_FORMAT_R32_TYPELESS, + DXGI_FORMAT_D32_FLOAT, + DXGI_FORMAT_R32_FLOAT, + DXGI_FORMAT_R32_UINT, + DXGI_FORMAT_R32_SINT, + DXGI_FORMAT_R24G8_TYPELESS, + DXGI_FORMAT_D24_UNORM_S8_UINT, + DXGI_FORMAT_R24_UNORM_X8_TYPELESS, + DXGI_FORMAT_X24_TYPELESS_G8_UINT, + DXGI_FORMAT_R8G8_TYPELESS, + DXGI_FORMAT_R8G8_UNORM, + DXGI_FORMAT_R8G8_UINT, + DXGI_FORMAT_R8G8_SNORM, + DXGI_FORMAT_R8G8_SINT, + DXGI_FORMAT_R16_TYPELESS, + DXGI_FORMAT_R16_FLOAT, + DXGI_FORMAT_D16_UNORM, + DXGI_FORMAT_R16_UNORM, + DXGI_FORMAT_R16_UINT, + DXGI_FORMAT_R16_SNORM, + DXGI_FORMAT_R16_SINT, + DXGI_FORMAT_R8_TYPELESS, + DXGI_FORMAT_R8_UNORM, + DXGI_FORMAT_R8_UINT, + DXGI_FORMAT_R8_SNORM, + DXGI_FORMAT_R8_SINT, + DXGI_FORMAT_A8_UNORM, + DXGI_FORMAT_R1_UNORM, + DXGI_FORMAT_R9G9B9E5_SHAREDEXP, + DXGI_FORMAT_R8G8_B8G8_UNORM, + DXGI_FORMAT_G8R8_G8B8_UNORM, + DXGI_FORMAT_BC1_TYPELESS, + DXGI_FORMAT_BC1_UNORM, + DXGI_FORMAT_BC1_UNORM_SRGB, + DXGI_FORMAT_BC2_TYPELESS, + DXGI_FORMAT_BC2_UNORM, + DXGI_FORMAT_BC2_UNORM_SRGB, + DXGI_FORMAT_BC3_TYPELESS, + DXGI_FORMAT_BC3_UNORM, + DXGI_FORMAT_BC3_UNORM_SRGB, + DXGI_FORMAT_BC4_TYPELESS, + DXGI_FORMAT_BC4_UNORM, + DXGI_FORMAT_BC4_SNORM, + DXGI_FORMAT_BC5_TYPELESS, + DXGI_FORMAT_BC5_UNORM, + DXGI_FORMAT_BC5_SNORM, + DXGI_FORMAT_B5G6R5_UNORM, + DXGI_FORMAT_B5G5R5A1_UNORM, + DXGI_FORMAT_B8G8R8A8_UNORM, + DXGI_FORMAT_B8G8R8X8_UNORM, + DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM, + DXGI_FORMAT_B8G8R8A8_TYPELESS, + DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, + DXGI_FORMAT_B8G8R8X8_TYPELESS, + DXGI_FORMAT_B8G8R8X8_UNORM_SRGB, + DXGI_FORMAT_BC6H_TYPELESS, + DXGI_FORMAT_BC6H_UF16, + DXGI_FORMAT_BC6H_SF16, + DXGI_FORMAT_BC7_TYPELESS, + DXGI_FORMAT_BC7_UNORM, + DXGI_FORMAT_BC7_UNORM_SRGB, + DXGI_FORMAT_AYUV, + DXGI_FORMAT_Y410, + DXGI_FORMAT_Y416, + DXGI_FORMAT_NV12, + DXGI_FORMAT_P010, + DXGI_FORMAT_P016, + DXGI_FORMAT_YUY2, + DXGI_FORMAT_Y210, + DXGI_FORMAT_Y216, + DXGI_FORMAT_AI44, + DXGI_FORMAT_IA44, + DXGI_FORMAT_P8, + DXGI_FORMAT_A8P8, + DXGI_FORMAT_B4G4R4A4_UNORM, + DXGI_FORMAT_V208, + DXGI_FORMAT_V408, + DXGI_FORMAT_FORCE_UINT}; cached_formats.reserve(arrayCount(DXGIFormats)); for (auto DXGIFormat : DXGIFormats) { UINT format = 0; diff --git a/opencl/source/os_interface/windows/d3d9_sharing_functions.cpp b/opencl/source/os_interface/windows/d3d9_sharing_functions.cpp index cf57388d98..dbe9a6edb0 100644 --- a/opencl/source/os_interface/windows/d3d9_sharing_functions.cpp +++ b/opencl/source/os_interface/windows/d3d9_sharing_functions.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -11,7 +11,8 @@ using namespace NEO; -template class D3DSharingFunctions; +template class NEO::D3DSharingFunctions; +template <> const uint32_t D3DSharingFunctions::sharingId = SharingType::D3D9_SHARING; template <> @@ -60,6 +61,7 @@ bool D3DSharingFunctions::checkFormatSupport(DXGI_FORMAT f return false; } +template <> cl_int D3DSharingFunctions::validateFormatSupport(DXGI_FORMAT format, cl_mem_object_type type) { return CL_SUCCESS; } diff --git a/opencl/source/os_interface/windows/d3d_sharing_functions.h b/opencl/source/os_interface/windows/d3d_sharing_functions.h index 63bbea66d4..b87cf33318 100644 --- a/opencl/source/os_interface/windows/d3d_sharing_functions.h +++ b/opencl/source/os_interface/windows/d3d_sharing_functions.h @@ -10,12 +10,25 @@ #include "opencl/source/sharings/sharing.h" +#if __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wignored-pragma-intrinsic" +#pragma clang diagnostic ignored "-Wpragma-pack" +#pragma clang diagnostic ignored "-Wignored-attributes" +#pragma clang diagnostic ignored "-Wmacro-redefined" +#pragma clang diagnostic ignored "-Wcomment" +#endif + #include #include #include #include +#if __clang__ +#pragma clang diagnostic pop +#endif + #include #include diff --git a/opencl/source/sharings/d3d/d3d_buffer.h b/opencl/source/sharings/d3d/d3d_buffer.h index d6c2929aa0..bb97c19c2e 100644 --- a/opencl/source/sharings/d3d/d3d_buffer.h +++ b/opencl/source/sharings/d3d/d3d_buffer.h @@ -60,6 +60,6 @@ class D3DBuffer : public D3DSharing { protected: D3DBuffer(Context *context, D3DBufferObj *d3dBuffer, D3DBufferObj *bufferStaging, bool sharedResource) - : D3DSharing(context, d3dBuffer, bufferStaging, 0, sharedResource){}; + : D3DSharing(context, d3dBuffer, bufferStaging, 0, sharedResource){}; }; } // namespace NEO diff --git a/opencl/source/sharings/d3d/d3d_sharing.cpp b/opencl/source/sharings/d3d/d3d_sharing.cpp index 0810038cc9..ba1e9e8c9c 100644 --- a/opencl/source/sharings/d3d/d3d_sharing.cpp +++ b/opencl/source/sharings/d3d/d3d_sharing.cpp @@ -14,9 +14,9 @@ using namespace NEO; -template class D3DSharing; -template class D3DSharing; -template class D3DSharing; +template class NEO::D3DSharing; +template class NEO::D3DSharing; +template class NEO::D3DSharing; template D3DSharing::D3DSharing(Context *context, D3DResource *resource, D3DResource *resourceStaging, unsigned int subresource, bool sharedResource) @@ -75,7 +75,7 @@ void D3DSharing::updateImgInfoAndDesc(Gmm *gmm, ImageInfo &imgInfo, ImagePl } template -const ClSurfaceFormatInfo *D3DSharing::findSurfaceFormatInfo(GMM_RESOURCE_FORMAT_ENUM gmmFormat, cl_mem_flags flags, bool supportsOcl20Features, bool packedSupported) { +const ClSurfaceFormatInfo *D3DSharing::findSurfaceFormatInfo(int gmmFormat, cl_mem_flags flags, bool supportsOcl20Features, bool packedSupported) { ArrayRef formats = SurfaceFormats::surfaceFormats(flags, supportsOcl20Features); for (auto &format : formats) { if (gmmFormat == format.surfaceFormat.gmmSurfaceFormat) { diff --git a/opencl/source/sharings/d3d/d3d_sharing.h b/opencl/source/sharings/d3d/d3d_sharing.h index 7102c7ebba..27218c3a32 100644 --- a/opencl/source/sharings/d3d/d3d_sharing.h +++ b/opencl/source/sharings/d3d/d3d_sharing.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -12,7 +12,6 @@ #include -enum GMM_RESOURCE_FORMAT_ENUM; namespace NEO { enum class ImagePlane; class Context; @@ -36,9 +35,9 @@ class D3DSharing : public SharingHandler { D3DResource **getResourceHandler() { return &resource; } void *getResourceStaging() { return resourceStaging; } unsigned int &getSubresource() { return subresource; } - typename D3DQuery *getQuery() { return d3dQuery; } + D3DQuery *getQuery() { return d3dQuery; } bool isSharedResource() { return sharedResource; } - static const ClSurfaceFormatInfo *findSurfaceFormatInfo(GMM_RESOURCE_FORMAT_ENUM gmmFormat, cl_mem_flags flags, bool supportsOcl20Features, bool packedSupported); + static const ClSurfaceFormatInfo *findSurfaceFormatInfo(int gmmFormat, cl_mem_flags flags, bool supportsOcl20Features, bool packedSupported); static bool isFormatWithPlane1(DXGI_FORMAT format); protected: diff --git a/opencl/source/sharings/d3d/d3d_surface.cpp b/opencl/source/sharings/d3d/d3d_surface.cpp index dca32e0c6c..ce83749b67 100644 --- a/opencl/source/sharings/d3d/d3d_surface.cpp +++ b/opencl/source/sharings/d3d/d3d_surface.cpp @@ -26,8 +26,8 @@ using namespace NEO; D3DSurface::D3DSurface(Context *context, cl_dx9_surface_info_khr *surfaceInfo, D3D9Surface *surfaceStaging, cl_uint plane, ImagePlane imagePlane, cl_dx9_media_adapter_type_khr adapterType, bool sharedResource, bool lockable) - : D3DSharing(context, surfaceInfo->resource, surfaceStaging, plane, sharedResource), adapterType(adapterType), - surfaceInfo(*surfaceInfo), lockable(lockable), plane(plane), imagePlane(imagePlane), d3d9Surface(surfaceInfo->resource), + : D3DSharing(context, surfaceInfo->resource, surfaceStaging, plane, sharedResource), lockable(lockable), adapterType(adapterType), + surfaceInfo(*surfaceInfo), plane(plane), imagePlane(imagePlane), d3d9Surface(surfaceInfo->resource), d3d9SurfaceStaging(surfaceStaging) { if (sharingFunctions) { resourceDevice = sharingFunctions->getDevice(); @@ -237,8 +237,9 @@ cl_int D3DSurface::findImgFormat(D3DFORMAT d3dFormat, cl_image_format &imgFormat } imgFormat = element->second; - switch (d3dFormat) { - case static_cast(MAKEFOURCC('N', 'V', '1', '2')): + int d3dFormatValue = d3dFormat; + switch (d3dFormatValue) { + case MAKEFOURCC('N', 'V', '1', '2'): switch (plane) { case 0: imgFormat.image_channel_order = CL_R; @@ -253,7 +254,7 @@ cl_int D3DSurface::findImgFormat(D3DFORMAT d3dFormat, cl_image_format &imgFormat return CL_INVALID_VALUE; } - case static_cast(MAKEFOURCC('Y', 'V', '1', '2')): + case MAKEFOURCC('Y', 'V', '1', '2'): switch (plane) { case 0: imagePlane = ImagePlane::PLANE_Y; diff --git a/opencl/source/sharings/d3d/d3d_texture.cpp b/opencl/source/sharings/d3d/d3d_texture.cpp index 3507587b56..00fcc250a8 100644 --- a/opencl/source/sharings/d3d/d3d_texture.cpp +++ b/opencl/source/sharings/d3d/d3d_texture.cpp @@ -25,8 +25,8 @@ using namespace NEO; -template class D3DTexture; -template class D3DTexture; +template class NEO::D3DTexture; +template class NEO::D3DTexture; template Image *D3DTexture::create2d(Context *context, D3DTexture2d *d3dTexture, cl_mem_flags flags, cl_uint subresource, cl_int *retCode) { diff --git a/opencl/source/sharings/d3d/d3d_texture.h b/opencl/source/sharings/d3d/d3d_texture.h index f78b23fdd7..8fab78a7c0 100644 --- a/opencl/source/sharings/d3d/d3d_texture.h +++ b/opencl/source/sharings/d3d/d3d_texture.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -31,6 +31,6 @@ class D3DTexture : public D3DSharing { protected: D3DTexture(Context *context, D3DResource *d3dTexture, cl_uint subresource, D3DResource *textureStaging, bool sharedResource) - : D3DSharing(context, d3dTexture, textureStaging, subresource, sharedResource){}; + : D3DSharing(context, d3dTexture, textureStaging, subresource, sharedResource){}; }; } // namespace NEO diff --git a/opencl/source/sharings/d3d/enable_d3d.cpp b/opencl/source/sharings/d3d/enable_d3d.cpp index 69ccfbf722..a745e50e59 100644 --- a/opencl/source/sharings/d3d/enable_d3d.cpp +++ b/opencl/source/sharings/d3d/enable_d3d.cpp @@ -1,11 +1,11 @@ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * */ -#ifdef WIN32 +#ifdef _WIN32 #include "opencl/source/sharings/d3d/enable_d3d.h" @@ -23,6 +23,7 @@ namespace NEO { +template <> bool D3DSharingContextBuilder::processProperties(cl_context_properties &propertyType, cl_context_properties &propertyValue) { if (contextData.get() == nullptr) { contextData = std::make_unique>(); @@ -42,6 +43,7 @@ bool D3DSharingContextBuilder::processProperties(cl_contex return false; } +template <> bool D3DSharingContextBuilder::processProperties(cl_context_properties &propertyType, cl_context_properties &propertyValue) { if (contextData.get() == nullptr) { contextData = std::make_unique>(); @@ -56,6 +58,7 @@ bool D3DSharingContextBuilder::processProperties(cl_conte return false; } +template <> bool D3DSharingContextBuilder::processProperties(cl_context_properties &propertyType, cl_context_properties &propertyValue) { if (contextData.get() == nullptr) { contextData = std::make_unique>(); @@ -99,18 +102,22 @@ std::unique_ptr D3DSharingBuilderFactory::createCont return std::make_unique>(); }; +template <> std::string D3DSharingBuilderFactory::getExtensions(DriverInfo *driverInfo) { return extensionEnabled ? "cl_intel_dx9_media_sharing cl_khr_dx9_media_sharing " : ""; } +template <> std::string D3DSharingBuilderFactory::getExtensions(DriverInfo *driverInfo) { return extensionEnabled ? "cl_khr_d3d10_sharing " : ""; } +template <> std::string D3DSharingBuilderFactory::getExtensions(DriverInfo *driverInfo) { return extensionEnabled ? "cl_khr_d3d11_sharing cl_intel_d3d11_nv12_media_sharing " : ""; } +template <> void D3DSharingBuilderFactory::fillGlobalDispatchTable() { icdGlobalDispatchTable.clGetDeviceIDsFromDX9MediaAdapterKHR = clGetDeviceIDsFromDX9MediaAdapterKHR; icdGlobalDispatchTable.clCreateFromDX9MediaSurfaceKHR = clCreateFromDX9MediaSurfaceKHR; @@ -123,6 +130,7 @@ void D3DSharingBuilderFactory::fillGlobalDispatchTable() { crtGlobalDispatchTable.clEnqueueReleaseDX9ObjectsINTEL = clEnqueueReleaseDX9ObjectsINTEL; } +template <> void D3DSharingBuilderFactory::fillGlobalDispatchTable() { icdGlobalDispatchTable.clCreateFromD3D10BufferKHR = clCreateFromD3D10BufferKHR; icdGlobalDispatchTable.clCreateFromD3D10Texture2DKHR = clCreateFromD3D10Texture2DKHR; @@ -132,6 +140,7 @@ void D3DSharingBuilderFactory::fillGlobalDispatchTable() icdGlobalDispatchTable.clGetDeviceIDsFromD3D10KHR = clGetDeviceIDsFromD3D10KHR; } +template <> void D3DSharingBuilderFactory::fillGlobalDispatchTable() { icdGlobalDispatchTable.clCreateFromD3D11BufferKHR = clCreateFromD3D11BufferKHR; icdGlobalDispatchTable.clCreateFromD3D11Texture2DKHR = clCreateFromD3D11Texture2DKHR; @@ -141,6 +150,7 @@ void D3DSharingBuilderFactory::fillGlobalDispatchTable() icdGlobalDispatchTable.clGetDeviceIDsFromD3D11KHR = clGetDeviceIDsFromD3D11KHR; } +template <> void *D3DSharingBuilderFactory::getExtensionFunctionAddress(const std::string &functionName) { if (DebugManager.flags.EnableFormatQuery.get() && functionName == "clGetSupportedDX9MediaSurfaceFormatsINTEL") { @@ -149,6 +159,7 @@ void *D3DSharingBuilderFactory::getExtensionFunctionAddres return nullptr; } +template <> void *D3DSharingBuilderFactory::getExtensionFunctionAddress(const std::string &functionName) { if (DebugManager.flags.EnableFormatQuery.get() && functionName == "clGetSupportedD3D10TextureFormatsINTEL") { @@ -157,6 +168,7 @@ void *D3DSharingBuilderFactory::getExtensionFunctionAddre return nullptr; } +template <> void *D3DSharingBuilderFactory::getExtensionFunctionAddress(const std::string &functionName) { if (DebugManager.flags.EnableFormatQuery.get() && functionName == "clGetSupportedD3D11TextureFormatsINTEL") { @@ -165,15 +177,18 @@ void *D3DSharingBuilderFactory::getExtensionFunctionAddre return nullptr; } +template <> void D3DSharingBuilderFactory::setExtensionEnabled(DriverInfo *driverInfo) { auto driverInfoWin = driverInfo->as(); extensionEnabled = driverInfo->getMediaSharingSupport() && driverInfoWin->containsSetting(is64bit ? "UserModeDriverName" : "UserModeDriverNameWOW"); } +template <> void D3DSharingBuilderFactory::setExtensionEnabled(DriverInfo *driverInfo) { extensionEnabled = driverInfo->getMediaSharingSupport(); } +template <> void D3DSharingBuilderFactory::setExtensionEnabled(DriverInfo *driverInfo) { extensionEnabled = driverInfo->getMediaSharingSupport(); } diff --git a/opencl/source/sharings/gl/gl_sharing.h b/opencl/source/sharings/gl/gl_sharing.h index 8501be50d2..f32816d327 100644 --- a/opencl/source/sharings/gl/gl_sharing.h +++ b/opencl/source/sharings/gl/gl_sharing.h @@ -12,7 +12,22 @@ #include "opencl/source/sharings/sharing.h" #include "CL/cl.h" + +#if __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wignored-pragma-intrinsic" +#pragma clang diagnostic ignored "-Wpragma-pack" +#pragma clang diagnostic ignored "-Wignored-attributes" +#pragma clang diagnostic ignored "-Wmacro-redefined" +#pragma clang diagnostic ignored "-Wnonportable-include-path" +#endif + #include "GL/gl.h" + +#if __clang__ +#pragma clang diagnostic pop + +#endif #include "GL/glext.h" #include diff --git a/opencl/test/unit_test/aub_tests/command_stream/aub_mem_dump_tests.h b/opencl/test/unit_test/aub_tests/command_stream/aub_mem_dump_tests.h index 82bb67e94d..b4a21dba84 100644 --- a/opencl/test/unit_test/aub_tests/command_stream/aub_mem_dump_tests.h +++ b/opencl/test/unit_test/aub_tests/command_stream/aub_mem_dump_tests.h @@ -16,7 +16,7 @@ #include "shared/source/os_interface/product_helper.h" #include "shared/test/common/test_macros/hw_test.h" -#include "aub_mapper.h" +#include "aub_mapper_common.h" namespace Os { extern const char *fileSeparator; diff --git a/shared/offline_compiler/source/CMakeLists.txt b/shared/offline_compiler/source/CMakeLists.txt index 8cdf839fd4..873450a7c7 100644 --- a/shared/offline_compiler/source/CMakeLists.txt +++ b/shared/offline_compiler/source/CMakeLists.txt @@ -263,7 +263,7 @@ target_compile_definitions(${OCLOC_NAME}_lib PUBLIC ${CLOC_LIB_LIB_FLAGS_DEFINIT ) target_compile_definitions(${OCLOC_NAME}_lib PUBLIC ${NEO__IGC_COMPILE_DEFINITIONS}) -if(MSVC) +if(WIN32) target_link_libraries(${OCLOC_NAME}_lib dbghelp) endif() diff --git a/shared/offline_compiler/source/utilities/windows/seh_exception.cpp b/shared/offline_compiler/source/utilities/windows/seh_exception.cpp index 1d4f7996a8..eff9e631c3 100644 --- a/shared/offline_compiler/source/utilities/windows/seh_exception.cpp +++ b/shared/offline_compiler/source/utilities/windows/seh_exception.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2020 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -23,7 +23,7 @@ #include std::string SehException::getExceptionDescription(unsigned int code) { - switch (code) { + switch (static_cast(code)) { case EXCEPTION_ACCESS_VIOLATION: return "Access violation"; case EXCEPTION_DATATYPE_MISALIGNMENT: @@ -44,7 +44,7 @@ int SehException::filter(unsigned int code, struct _EXCEPTION_POINTERS *ep) { printf("EXCEPTION: %s\n", SehException::getExceptionDescription(code).c_str()); - if (code != EXCEPTION_STACK_OVERFLOW) { + if (static_cast(code) != EXCEPTION_STACK_OVERFLOW) { std::string callstack; SehException::getCallStack(code, ep, callstack); diff --git a/shared/source/CMakeLists.txt b/shared/source/CMakeLists.txt index 8ac503d9bf..308227bec5 100644 --- a/shared/source/CMakeLists.txt +++ b/shared/source/CMakeLists.txt @@ -188,7 +188,11 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${BRANCH_TYPE}/core_sources.cmake) endif() if(NOT MSVC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive -fPIC") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive") +endif() + +if(NOT WIN32) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") endif() if(DONT_CARE_OF_VIRTUALS) diff --git a/shared/source/aub_mem_dump/aub_mem_dump_pvc_and_later.inl b/shared/source/aub_mem_dump/aub_mem_dump_pvc_and_later.inl index fdf7e748e9..f8117d86d4 100644 --- a/shared/source/aub_mem_dump/aub_mem_dump_pvc_and_later.inl +++ b/shared/source/aub_mem_dump/aub_mem_dump_pvc_and_later.inl @@ -12,7 +12,7 @@ #include "shared/source/helpers/completion_stamp.h" #include "shared/source/helpers/gfx_core_helper.h" -#include "aub_mapper.h" +#include "aub_mapper_common.h" #include "config.h" #include "reg_configs_common.h" diff --git a/shared/source/aub_mem_dump/aub_mem_dump_xehp_and_later.inl b/shared/source/aub_mem_dump/aub_mem_dump_xehp_and_later.inl index a4a1455ceb..1dcdd72d44 100644 --- a/shared/source/aub_mem_dump/aub_mem_dump_xehp_and_later.inl +++ b/shared/source/aub_mem_dump/aub_mem_dump_xehp_and_later.inl @@ -12,7 +12,7 @@ #include "shared/source/helpers/completion_stamp.h" #include "shared/source/helpers/gfx_core_helper.h" -#include "aub_mapper.h" +#include "aub_mapper_common.h" #include "config.h" #include "reg_configs_common.h" diff --git a/shared/source/command_stream/command_stream_receiver_simulated_common_hw.h b/shared/source/command_stream/command_stream_receiver_simulated_common_hw.h index 44e92857fa..18a50fcb32 100644 --- a/shared/source/command_stream/command_stream_receiver_simulated_common_hw.h +++ b/shared/source/command_stream/command_stream_receiver_simulated_common_hw.h @@ -9,7 +9,7 @@ #include "shared/source/command_stream/command_stream_receiver_hw.h" #include "shared/source/memory_manager/memory_banks.h" -#include "aub_mapper.h" +#include "aub_mapper_common.h" #include "aubstream/hardware_context.h" namespace aub_stream { diff --git a/shared/source/command_stream/submissions_aggregator.cpp b/shared/source/command_stream/submissions_aggregator.cpp index 70f6616783..f772967af0 100644 --- a/shared/source/command_stream/submissions_aggregator.cpp +++ b/shared/source/command_stream/submissions_aggregator.cpp @@ -108,3 +108,5 @@ NEO::BatchBuffer::BatchBuffer(GraphicsAllocation *commandBufferAllocation, size_ NEO::CommandBuffer::CommandBuffer(Device &device) : device(device) { flushStamp.reset(new FlushStampTracker(false)); } + +NEO::CommandBuffer::~CommandBuffer() = default; diff --git a/shared/source/command_stream/submissions_aggregator.h b/shared/source/command_stream/submissions_aggregator.h index 78bbcd774f..f2d64e4dbe 100644 --- a/shared/source/command_stream/submissions_aggregator.h +++ b/shared/source/command_stream/submissions_aggregator.h @@ -61,6 +61,7 @@ struct BatchBuffer { struct CommandBuffer : public IDNode { CommandBuffer(Device &device); + ~CommandBuffer() override; ResidencyContainer surfaces; BatchBuffer batchBuffer; void *batchBufferEndLocation = nullptr; diff --git a/shared/source/command_stream/tbx_command_stream_receiver_hw.h b/shared/source/command_stream/tbx_command_stream_receiver_hw.h index 0020d89791..c168cdbc49 100644 --- a/shared/source/command_stream/tbx_command_stream_receiver_hw.h +++ b/shared/source/command_stream/tbx_command_stream_receiver_hw.h @@ -12,8 +12,6 @@ #include "shared/source/memory_manager/address_mapper.h" #include "shared/source/memory_manager/page_table.h" -#include "aub_mapper.h" - #include namespace NEO { diff --git a/shared/source/debugger/windows/debugger_l0_windows.cpp b/shared/source/debugger/windows/debugger_l0_windows.cpp index 666da5c963..1293867b57 100644 --- a/shared/source/debugger/windows/debugger_l0_windows.cpp +++ b/shared/source/debugger/windows/debugger_l0_windows.cpp @@ -63,7 +63,7 @@ void DebuggerL0::registerAllocationType(GraphicsAllocation *allocation) { return; } - WddmAllocation::RegistrationData registrationData = {0}; + WddmAllocation::RegistrationData registrationData = {}; registrationData.gpuVirtualAddress = wddmAllocation->getGpuAddress(); registrationData.size = wddmAllocation->getUnderlyingBufferSize(); @@ -75,7 +75,7 @@ void DebuggerL0::registerAllocationType(GraphicsAllocation *allocation) { allocationDebugDataInfo.DataSize = sizeof(registrationData); allocationDebugDataInfo.DataPointer = reinterpret_cast(®istrationData); - KM_ESCAPE_INFO escapeInfo = {0}; + KM_ESCAPE_INFO escapeInfo = {}; escapeInfo.Header.EscapeCode = GFX_ESCAPE_KMD; escapeInfo.Header.Size = sizeof(escapeInfo) - sizeof(escapeInfo.Header); escapeInfo.EscapeOperation = KM_ESCAPE_EUDBG_UMD_REGISTER_ALLOCATION_TYPE; @@ -84,7 +84,7 @@ void DebuggerL0::registerAllocationType(GraphicsAllocation *allocation) { escapeInfo.KmEuDbgUmdRegisterAllocationData.NumOfDebugDataInfo = 1; escapeInfo.KmEuDbgUmdRegisterAllocationData.DebugDataBufferPtr = reinterpret_cast(&allocationDebugDataInfo); - D3DKMT_ESCAPE escapeCommand = {0}; + D3DKMT_ESCAPE escapeCommand = {}; escapeCommand.Flags.HardwareAccess = 0; escapeCommand.Flags.Reserved = 0; escapeCommand.hAdapter = wddm->getAdapter(); @@ -115,7 +115,7 @@ void DebuggerL0::notifyModuleCreate(void *module, uint32_t moduleSize, uint64_t } // Register ELF - KM_ESCAPE_INFO escapeInfo = {0}; + KM_ESCAPE_INFO escapeInfo = {}; escapeInfo.Header.EscapeCode = GFX_ESCAPE_KMD; escapeInfo.Header.Size = sizeof(escapeInfo) - sizeof(escapeInfo.Header); escapeInfo.EscapeOperation = KM_ESCAPE_EUDBG_UMD_CREATE_DEBUG_DATA; @@ -125,7 +125,7 @@ void DebuggerL0::notifyModuleCreate(void *module, uint32_t moduleSize, uint64_t auto wddm = device->getRootDeviceEnvironment().osInterface->getDriverModel()->as(); - D3DKMT_ESCAPE escapeCommand = {0}; + D3DKMT_ESCAPE escapeCommand = {}; escapeCommand.Flags.HardwareAccess = 0; escapeCommand.Flags.Reserved = 0; escapeCommand.hAdapter = wddm->getAdapter(); @@ -145,7 +145,7 @@ void DebuggerL0::notifyModuleCreate(void *module, uint32_t moduleSize, uint64_t PRINT_DEBUGGER_INFO_LOG("KM_ESCAPE_EUDBG_UMD_CREATE_DEBUG_DATA - Success\n"); // Fire MODULE_CREATE event - escapeInfo = {0}; + escapeInfo = {}; escapeInfo.Header.EscapeCode = GFX_ESCAPE_KMD; escapeInfo.Header.Size = sizeof(escapeInfo) - sizeof(escapeInfo.Header); escapeInfo.EscapeOperation = KM_ESCAPE_EUDBG_UMD_MODULE_CREATE_NOTIFY; @@ -169,7 +169,7 @@ void DebuggerL0::notifyModuleDestroy(uint64_t moduleLoadAddress) { return; } - KM_ESCAPE_INFO escapeInfo = {0}; + KM_ESCAPE_INFO escapeInfo = {}; escapeInfo.Header.EscapeCode = GFX_ESCAPE_KMD; escapeInfo.Header.Size = sizeof(escapeInfo) - sizeof(escapeInfo.Header); escapeInfo.EscapeOperation = KM_ESCAPE_EUDBG_UMD_MODULE_CREATE_NOTIFY; @@ -180,7 +180,7 @@ void DebuggerL0::notifyModuleDestroy(uint64_t moduleLoadAddress) { auto wddm = device->getRootDeviceEnvironment().osInterface->getDriverModel()->as(); - D3DKMT_ESCAPE escapeCommand = {0}; + D3DKMT_ESCAPE escapeCommand = {}; escapeCommand.Flags.HardwareAccess = 0; escapeCommand.Flags.Reserved = 0; escapeCommand.hAdapter = wddm->getAdapter(); @@ -205,7 +205,7 @@ bool DebuggerL0::removeZebinModule(uint32_t moduleHandle) { } static NTSTATUS runEscape(NEO::Wddm *wddm, KM_ESCAPE_INFO &escapeInfo) { - D3DKMT_ESCAPE escapeCommand = {0}; + D3DKMT_ESCAPE escapeCommand = {}; escapeInfo.Header.EscapeCode = GFX_ESCAPE_KMD; escapeInfo.Header.Size = sizeof(escapeInfo) - sizeof(escapeInfo.Header); @@ -229,7 +229,7 @@ void DebuggerL0::notifyCommandQueueCreated(NEO::Device *deviceIn) { if (++commandQueueCount[0] == 1) { auto pWddm = device->getRootDeviceEnvironment().osInterface->getDriverModel()->as(); int val = 0; - KM_ESCAPE_INFO escapeInfo = {0}; + KM_ESCAPE_INFO escapeInfo = {}; escapeInfo.KmEuDbgUmdCreateDebugData.DataSize = sizeof(val); escapeInfo.KmEuDbgUmdCreateDebugData.DebugDataType = static_cast(NEO::DebugDataType::CMD_QUEUE_CREATED); escapeInfo.KmEuDbgUmdCreateDebugData.hElfAddressPtr = reinterpret_cast(&val); @@ -245,7 +245,7 @@ void DebuggerL0::notifyCommandQueueDestroyed(NEO::Device *deviceIn) { if (--commandQueueCount[0] == 0) { auto pWddm = device->getRootDeviceEnvironment().osInterface->getDriverModel()->as(); int val = 0; - KM_ESCAPE_INFO escapeInfo = {0}; + KM_ESCAPE_INFO escapeInfo = {}; escapeInfo.KmEuDbgUmdCreateDebugData.DataSize = sizeof(val); escapeInfo.KmEuDbgUmdCreateDebugData.DebugDataType = static_cast(NEO::DebugDataType::CMD_QUEUE_DESTROYED); escapeInfo.KmEuDbgUmdCreateDebugData.hElfAddressPtr = reinterpret_cast(&val); diff --git a/shared/source/dll/windows/environment_variables.cpp b/shared/source/dll/windows/environment_variables.cpp index 9e7ffb4ad9..054da29772 100644 --- a/shared/source/dll/windows/environment_variables.cpp +++ b/shared/source/dll/windows/environment_variables.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -8,8 +8,7 @@ #include "shared/source/os_interface/windows/environment_variables.h" #include "shared/source/debug_settings/debug_settings_manager.h" - -#include +#include "shared/source/os_interface/windows/windows_wrapper.h" uint32_t getEnvironmentVariable(const char *name, char *outBuffer, uint32_t outBufferSize) { if (NEO::DebugManager.registryReadAvailable() == false) { diff --git a/shared/source/gen_common/CMakeLists.txt b/shared/source/gen_common/CMakeLists.txt index 7cd271e46a..a0bc7c9572 100644 --- a/shared/source/gen_common/CMakeLists.txt +++ b/shared/source/gen_common/CMakeLists.txt @@ -1,11 +1,11 @@ # -# Copyright (C) 2020-2021 Intel Corporation +# Copyright (C) 2020-2023 Intel Corporation # # SPDX-License-Identifier: MIT # set(NEO_CORE_GEN_COMMON - ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}aub_mapper.h + ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}aub_mapper_common.h ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}reg_configs_common.h ) diff --git a/shared/source/gen_common/aub_mapper.h b/shared/source/gen_common/aub_mapper_common.h similarity index 92% rename from shared/source/gen_common/aub_mapper.h rename to shared/source/gen_common/aub_mapper_common.h index 194feab1c2..1ea761d7f2 100644 --- a/shared/source/gen_common/aub_mapper.h +++ b/shared/source/gen_common/aub_mapper_common.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * SPDX-License-Identifier: MIT * diff --git a/shared/source/gmm_helper/gmm_helper.h b/shared/source/gmm_helper/gmm_helper.h index b46449d64f..aa9e9a8e68 100644 --- a/shared/source/gmm_helper/gmm_helper.h +++ b/shared/source/gmm_helper/gmm_helper.h @@ -6,7 +6,6 @@ */ #pragma once - #include namespace NEO { diff --git a/shared/source/gmm_helper/gmm_lib.h b/shared/source/gmm_helper/gmm_lib.h index d2296ef82b..e75b87c6d1 100644 --- a/shared/source/gmm_helper/gmm_lib.h +++ b/shared/source/gmm_helper/gmm_lib.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -26,8 +26,20 @@ #endif // !WDDM_LINUX #endif // !_WIN32 +#if __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnonportable-include-path" +#pragma clang diagnostic ignored "-Wmissing-braces" +#pragma clang diagnostic ignored "-Wparentheses-equality" + +#endif + #include "GmmLib.h" +#if __clang__ +#pragma clang diagnostic pop +#endif + #ifdef RESTORE_WDDM_LINUX #ifdef RESTORE_LHDM #define LHDM 1 diff --git a/shared/source/os_interface/windows/debug_registry_reader.h b/shared/source/os_interface/windows/debug_registry_reader.h index ae7a62fa51..ea8097ad79 100644 --- a/shared/source/os_interface/windows/debug_registry_reader.h +++ b/shared/source/os_interface/windows/debug_registry_reader.h @@ -7,10 +7,9 @@ #pragma once +#include "shared/source/os_interface/windows/windows_wrapper.h" #include "shared/source/utilities/debug_settings_reader.h" -#include - #include #include diff --git a/shared/source/os_interface/windows/driver_info_windows.cpp b/shared/source/os_interface/windows/driver_info_windows.cpp index d0b98c3713..48c07f49c2 100644 --- a/shared/source/os_interface/windows/driver_info_windows.cpp +++ b/shared/source/os_interface/windows/driver_info_windows.cpp @@ -58,7 +58,7 @@ std::string DriverInfoWindows::getVersion(std::string defaultVersion) { }; bool DriverInfoWindows::isCompatibleDriverStore() const { - auto toLowerAndUnifyDriverStore = [](std::string &input) -> std::string { + auto toLowerAndUnifyDriverStore = [](std::string input) -> std::string { std::transform(input.begin(), input.end(), input.begin(), [](unsigned char c) { return std::tolower(c); }); auto hostDriverStorePos = input.find("\\hostdriverstore\\"); if (hostDriverStorePos != std::string::npos) { diff --git a/shared/source/os_interface/windows/dxcore_wrapper.h b/shared/source/os_interface/windows/dxcore_wrapper.h index a1e73db0b8..849b76e961 100644 --- a/shared/source/os_interface/windows/dxcore_wrapper.h +++ b/shared/source/os_interface/windows/dxcore_wrapper.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -12,8 +12,20 @@ #include "shared/source/os_interface/windows/windows_wrapper.h" #endif +#if __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wignored-pragma-intrinsic" +#pragma clang diagnostic ignored "-Wpragma-pack" +#pragma clang diagnostic ignored "-Wignored-attributes" +#pragma clang diagnostic ignored "-Wmacro-redefined" +#endif + #include +#if __clang__ +#pragma clang diagnostic pop +#endif + static const char *const dXCoreCreateAdapterFactoryFuncName = "DXCoreCreateAdapterFactory"; #ifndef _WIN32 diff --git a/shared/source/os_interface/windows/kmdaf_listener.cpp b/shared/source/os_interface/windows/kmdaf_listener.cpp index cc19015e34..bf255f3feb 100644 --- a/shared/source/os_interface/windows/kmdaf_listener.cpp +++ b/shared/source/os_interface/windows/kmdaf_listener.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -8,7 +8,7 @@ #include "shared/source/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" +#include "kmDaf.h" #pragma warning(pop) // restore state. namespace NEO { diff --git a/shared/source/os_interface/windows/os_library_win.cpp b/shared/source/os_interface/windows/os_library_win.cpp index 900f0985eb..118040c678 100644 --- a/shared/source/os_interface/windows/os_library_win.cpp +++ b/shared/source/os_interface/windows/os_library_win.cpp @@ -96,7 +96,7 @@ bool OsLibrary::isLoaded() { } void *OsLibrary::getProcAddress(const std::string &procName) { - return ::GetProcAddress(this->handle, procName.c_str()); + return reinterpret_cast(::GetProcAddress(this->handle, procName.c_str())); } std::string OsLibrary::getFullPath() { diff --git a/shared/source/os_interface/windows/os_memory_win.h b/shared/source/os_interface/windows/os_memory_win.h index dbf0ed63a6..9ff1a438bd 100644 --- a/shared/source/os_interface/windows/os_memory_win.h +++ b/shared/source/os_interface/windows/os_memory_win.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2022 Intel Corporation + * Copyright (C) 2019-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -8,8 +8,7 @@ #pragma once #include "shared/source/os_interface/os_memory.h" - -#include +#include "shared/source/os_interface/windows/windows_wrapper.h" namespace NEO { diff --git a/shared/source/os_interface/windows/os_socket.h b/shared/source/os_interface/windows/os_socket.h index 2f8e9c0d46..b5c329315b 100644 --- a/shared/source/os_interface/windows/os_socket.h +++ b/shared/source/os_interface/windows/os_socket.h @@ -1,9 +1,9 @@ /* - * Copyright (C) 2020-2021 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * SPDX-License-Identifier: MIT * */ #pragma once -#include +#include "shared/source/os_interface/windows/windows_wrapper.h" diff --git a/shared/source/os_interface/windows/performance_counters_win.cpp b/shared/source/os_interface/windows/performance_counters_win.cpp index 406f9c3439..7af30efc66 100644 --- a/shared/source/os_interface/windows/performance_counters_win.cpp +++ b/shared/source/os_interface/windows/performance_counters_win.cpp @@ -25,7 +25,7 @@ std::unique_ptr PerformanceCounters::create(Device *device) counter->clientData.Windows.Adapter = reinterpret_cast(static_cast(wddm->getAdapter())); counter->clientData.Windows.Device = reinterpret_cast(static_cast(wddm->getDeviceHandle())); - counter->clientData.Windows.Escape = wddm->getEscapeHandle(); + counter->clientData.Windows.Escape = reinterpret_cast(wddm->getEscapeHandle()); counter->clientData.Windows.KmdInstrumentationEnabled = device->getHardwareInfo().capabilityTable.instrumentationEnabled; counter->contextData.ClientData = &counter->clientData; counter->clientType.Gen = static_cast(gfxCoreHelper.getMetricsLibraryGenId()); diff --git a/shared/source/os_interface/windows/wddm/adapter_factory_dxgi.h b/shared/source/os_interface/windows/wddm/adapter_factory_dxgi.h index 2356a64f6b..56f03971e7 100644 --- a/shared/source/os_interface/windows/wddm/adapter_factory_dxgi.h +++ b/shared/source/os_interface/windows/wddm/adapter_factory_dxgi.h @@ -31,7 +31,7 @@ class DxgiAdapterFactory : public AdapterFactory { return nullptr != adapterFactory; } - uint32_t getNumAdaptersInSnapshot() { + uint32_t getNumAdaptersInSnapshot() override { return static_cast(adaptersInSnapshot.size()); } diff --git a/shared/source/os_interface/windows/windows_wrapper.h b/shared/source/os_interface/windows/windows_wrapper.h index 1a3cc942c7..ba2ddc8c0e 100644 --- a/shared/source/os_interface/windows/windows_wrapper.h +++ b/shared/source/os_interface/windows/windows_wrapper.h @@ -7,11 +7,24 @@ #pragma once #if _WIN32 -#include +#if __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wignored-pragma-intrinsic" +#pragma clang diagnostic ignored "-Wpragma-pack" +#pragma clang diagnostic ignored "-Wignored-attributes" +#pragma clang diagnostic ignored "-Wmacro-redefined" +#define UNICODE +#endif + +#include #include #include +#if __clang__ +#pragma clang diagnostic pop +#endif + #pragma warning(push) #pragma warning(disable : 4005) #include diff --git a/shared/source/page_fault_manager/windows/cpu_page_fault_manager_windows.cpp b/shared/source/page_fault_manager/windows/cpu_page_fault_manager_windows.cpp index d317e1759f..bea3c7cf4b 100644 --- a/shared/source/page_fault_manager/windows/cpu_page_fault_manager_windows.cpp +++ b/shared/source/page_fault_manager/windows/cpu_page_fault_manager_windows.cpp @@ -38,7 +38,7 @@ bool PageFaultManagerWindows::checkFaultHandlerFromPageFaultManager() { void PageFaultManagerWindows::registerFaultHandler() { pageFaultHandler = [this](struct _EXCEPTION_POINTERS *exceptionInfo) { - if (exceptionInfo->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) { + if (static_cast(exceptionInfo->ExceptionRecord->ExceptionCode) == EXCEPTION_ACCESS_VIOLATION) { if (this->verifyPageFault(reinterpret_cast(exceptionInfo->ExceptionRecord->ExceptionInformation[1]))) { // this is our fault that we serviced, continue app execution return EXCEPTION_CONTINUE_EXECUTION; diff --git a/shared/source/page_fault_manager/windows/cpu_page_fault_manager_windows.h b/shared/source/page_fault_manager/windows/cpu_page_fault_manager_windows.h index 8839b3960d..51d9c0e997 100644 --- a/shared/source/page_fault_manager/windows/cpu_page_fault_manager_windows.h +++ b/shared/source/page_fault_manager/windows/cpu_page_fault_manager_windows.h @@ -7,10 +7,9 @@ #pragma once +#include "shared/source/os_interface/windows/windows_wrapper.h" #include "shared/source/page_fault_manager/cpu_page_fault_manager.h" -#include - #include namespace NEO { diff --git a/shared/source/tbx/tbx_sockets_imp.cpp b/shared/source/tbx/tbx_sockets_imp.cpp index ffadc21ca9..41efe6a27f 100644 --- a/shared/source/tbx/tbx_sockets_imp.cpp +++ b/shared/source/tbx/tbx_sockets_imp.cpp @@ -10,9 +10,9 @@ #include "shared/source/helpers/debug_helpers.h" #include "shared/source/helpers/string.h" -#ifdef WIN32 -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN +#ifdef _WIN32 +#ifndef _WIN32_LEAN_AND_MEAN +#define _WIN32_LEAN_AND_MEAN #endif typedef int socklen_t; #else @@ -118,7 +118,7 @@ bool TbxSocketsImp::connectToServer(const std::string &hostNameOrIp, uint16_t po clientService.sin_family = AF_INET; clientService.sin_port = htons(port); - if (::connect(socket, (SOCKADDR *)&clientService, sizeof(clientService)) == INVALID_SOCKET) { + if (::connect(socket, (SOCKADDR *)&clientService, sizeof(clientService)) == static_cast(INVALID_SOCKET)) { logErrorInfo("Failed to connect: "); cerrStream << "Is TBX server process running on host system [ " << hostNameOrIp.c_str() << ", port " << port << "]?" << std::endl; @@ -278,7 +278,7 @@ bool TbxSocketsImp::sendWriteData(const void *buffer, size_t sizeInBytes) { do { auto bytesSent = ::send(socket, &dataBuffer[totalSent], static_cast(sizeInBytes - totalSent), 0); - if (bytesSent == 0 || bytesSent == INVALID_SOCKET) { + if (bytesSent == 0 || bytesSent == static_cast(INVALID_SOCKET)) { logErrorInfo("Connection Closed."); return false; } @@ -295,7 +295,7 @@ bool TbxSocketsImp::getResponseData(void *buffer, size_t sizeInBytes) { do { auto bytesRecv = ::recv(socket, &dataBuffer[totalRecv], static_cast(sizeInBytes - totalRecv), 0); - if (bytesRecv == 0 || bytesRecv == INVALID_SOCKET) { + if (bytesRecv == 0 || bytesRecv == static_cast(INVALID_SOCKET)) { logErrorInfo("Connection Closed."); return false; } diff --git a/shared/source/utilities/software_tags_manager.h b/shared/source/utilities/software_tags_manager.h index 465c8a2818..28209d9f33 100644 --- a/shared/source/utilities/software_tags_manager.h +++ b/shared/source/utilities/software_tags_manager.h @@ -44,7 +44,7 @@ class SWTagsManager { unsigned int currentCallCount = 0; unsigned int getCurrentHeapOffset() { return currentHeapOffset; } - private: + protected: void allocateBXMLHeap(Device &device); void allocateSWTagHeap(Device &device); diff --git a/shared/source/utilities/windows/timer_util.cpp b/shared/source/utilities/windows/timer_util.cpp index ea2edd64f8..ff0f5c09b9 100644 --- a/shared/source/utilities/windows/timer_util.cpp +++ b/shared/source/utilities/windows/timer_util.cpp @@ -73,7 +73,7 @@ class Timer::TimerImpl { }; LARGE_INTEGER Timer::TimerImpl::mFrequency = { - {{0}}, + {}, }; Timer::Timer() { diff --git a/shared/test/common/fixtures/memory_management_fixture.cpp b/shared/test/common/fixtures/memory_management_fixture.cpp index d70070dcfb..8794e8493c 100644 --- a/shared/test/common/fixtures/memory_management_fixture.cpp +++ b/shared/test/common/fixtures/memory_management_fixture.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -17,10 +17,21 @@ #include #include #elif defined(_WIN32) -#include +#include "shared/source/os_interface/windows/windows_wrapper.h" #pragma warning(push) // Saves the current warning state. #pragma warning(disable : 4091) // Temporarily disables warning 4091. + +#if __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpragma-pack" +#endif + #include + +#if __clang__ +#pragma clang diagnostic pop +#endif + #pragma warning(pop) // Restores the warning state. #pragma comment(lib, "Dbghelp.lib") #endif diff --git a/shared/test/common/helpers/memory_management.cpp b/shared/test/common/helpers/memory_management.cpp index f44838b5d7..434740098d 100644 --- a/shared/test/common/helpers/memory_management.cpp +++ b/shared/test/common/helpers/memory_management.cpp @@ -23,9 +23,18 @@ #include #include #elif defined(_WIN32) -#include +#include "shared/source/os_interface/windows/windows_wrapper.h" + +#if __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpragma-pack" +#endif #include + +#if __clang__ +#pragma clang diagnostic pop +#endif #endif namespace MemoryManagement { diff --git a/shared/test/common/mocks/windows/mock_wddm_eudebug.h b/shared/test/common/mocks/windows/mock_wddm_eudebug.h index 50c1c98676..4e9a0a19f5 100644 --- a/shared/test/common/mocks/windows/mock_wddm_eudebug.h +++ b/shared/test/common/mocks/windows/mock_wddm_eudebug.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 Intel Corporation + * Copyright (C) 2022-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -154,9 +154,9 @@ struct WddmEuDebugInterfaceMock : public WddmMock { uint32_t seqNo = 0; union { READ_EVENT_PARAMS_BUFFER eventParamsBuffer; - uint8_t rawBytes[READ_EVENT_PARAMS_BUFFER_MIN_SIZE_BYTES] = {0}; + uint8_t rawBytes[READ_EVENT_PARAMS_BUFFER_MIN_SIZE_BYTES] = {}; } eventParamsBuffer; - } eventQueue[10] = {0}; + } eventQueue[10] = {}; struct { EUDBG_L0DBGUMD_ESCAPE_RETURN_TYPE escapeReturnStatus = DBGUMD_RETURN_ESCAPE_SUCCESS; @@ -166,7 +166,7 @@ struct WddmEuDebugInterfaceMock : public WddmMock { struct { uint32_t allocDataSize = 0; - uint32_t allocData[100] = {0}; + uint32_t allocData[100] = {}; } registerAllocationTypePassedParams; struct { @@ -179,19 +179,19 @@ struct WddmEuDebugInterfaceMock : public WddmMock { NTSTATUS ntStatus = STATUS_SUCCESS; } moduleCreateNotificationPassedParam; - DBGUMD_ACTION_ACKNOWLEDGE_EVENT_PARAMS acknowledgeEventPassedParam = {0}; + DBGUMD_ACTION_ACKNOWLEDGE_EVENT_PARAMS acknowledgeEventPassedParam = {}; bool debugAttachAvailable = true; NTSTATUS ntStatus = STATUS_SUCCESS; EUDBG_L0DBGUMD_ESCAPE_RETURN_TYPE escapeReturnStatus = DBGUMD_RETURN_ESCAPE_SUCCESS; uint64_t debugHandle = 0x0DEB0DEB; - uint32_t dbgUmdEscapeActionCalled[DBGUMD_ACTION_MAX] = {0}; + uint32_t dbgUmdEscapeActionCalled[DBGUMD_ACTION_MAX] = {}; uint32_t registerAllocationTypeCalled = 0; uint32_t createDebugDataCalled = 0; uint32_t moduleCreateNotifyCalled = 0; static constexpr size_t bufferSize = 16; - uint8_t testBuffer[bufferSize] = {0}; + uint8_t testBuffer[bufferSize] = {}; uint64_t mockGpuVa = 0x12345678; void *srcReadBuffer = nullptr; uint64_t srcReadBufferBaseAddress = 0; diff --git a/shared/test/common/os_interface/windows/mock_environment_variables.cpp b/shared/test/common/os_interface/windows/mock_environment_variables.cpp index 059b7c1d71..71b8343f5d 100644 --- a/shared/test/common/os_interface/windows/mock_environment_variables.cpp +++ b/shared/test/common/os_interface/windows/mock_environment_variables.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Intel Corporation + * Copyright (C) 2019-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -9,7 +9,7 @@ #include "shared/source/os_interface/windows/environment_variables.h" -extern uint32_t (*getEnvironmentVariableMock)(const char *name, char *outBuffer, uint32_t outBufferSize) = nullptr; +uint32_t (*getEnvironmentVariableMock)(const char *name, char *outBuffer, uint32_t outBufferSize) = nullptr; uint32_t getEnvironmentVariable(const char *name, char *outBuffer, uint32_t outBufferSize) { if (getEnvironmentVariableMock == nullptr) { diff --git a/shared/test/common/os_interface/windows/signal_utils.cpp b/shared/test/common/os_interface/windows/signal_utils.cpp index 96293f27b6..158540f9ca 100644 --- a/shared/test/common/os_interface/windows/signal_utils.cpp +++ b/shared/test/common/os_interface/windows/signal_utils.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 Intel Corporation + * Copyright (C) 2022-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -7,8 +7,9 @@ #include "shared/test/common/libult/signal_utils.h" +#include "shared/source/os_interface/windows/windows_wrapper.h" + #include "gtest/gtest.h" -#include #include #include diff --git a/shared/test/common/os_interface/windows/ult_dxgi_factory.h b/shared/test/common/os_interface/windows/ult_dxgi_factory.h index 188d4799fa..7d7872b7e6 100644 --- a/shared/test/common/os_interface/windows/ult_dxgi_factory.h +++ b/shared/test/common/os_interface/windows/ult_dxgi_factory.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -15,6 +15,7 @@ namespace NEO { class UltIDXGIAdapter1 : public IDXGIAdapter1 { public: + virtual ~UltIDXGIAdapter1() = default; const static wchar_t *description; // IDXGIAdapter1 HRESULT STDMETHODCALLTYPE GetDesc1( @@ -96,6 +97,7 @@ class UltIDXGIAdapter1 : public IDXGIAdapter1 { extern uint32_t numRootDevicesToEnum; class UltIDXGIFactory1 : public IDXGIFactory1 { public: + virtual ~UltIDXGIFactory1() = default; HRESULT STDMETHODCALLTYPE EnumAdapters1( UINT Adapter, IDXGIAdapter1 **ppAdapter) { diff --git a/shared/test/unit_test/compiler_interface/windows/compiler_cache_tests_windows.cpp b/shared/test/unit_test/compiler_interface/windows/compiler_cache_tests_windows.cpp index 418e9857ec..9cd88accfb 100644 --- a/shared/test/unit_test/compiler_interface/windows/compiler_cache_tests_windows.cpp +++ b/shared/test/unit_test/compiler_interface/windows/compiler_cache_tests_windows.cpp @@ -505,7 +505,8 @@ TEST_F(CompilerCacheWindowsTest, givenCreateUniqueTempFileAndWriteDataWhenCreate const char *binary = "12345"; SysCalls::writeFileNumberOfBytesWritten = static_cast(strlen(binary)); - cache.createUniqueTempFileAndWriteData("somePath\\cl_cache\\TMP.XXXXXX", binary, strlen(binary)); + char tmpFileName[] = "somePath\\cl_cache\\TMP.XXXXXX"; + cache.createUniqueTempFileAndWriteData(tmpFileName, binary, strlen(binary)); EXPECT_EQ(0, strcmp(SysCalls::writeFileBuffer, binary)); EXPECT_EQ(1u, SysCalls::getTempFileNameACalled); @@ -525,7 +526,8 @@ TEST_F(CompilerCacheWindowsTest, givenCreateUniqueTempFileAndWriteDataWhenGetTem const char *binary = "12345"; ::testing::internal::CaptureStderr(); - cache.createUniqueTempFileAndWriteData("somePath\\cl_cache\\TMP.XXXXXX", binary, strlen(binary)); + char tmpFileName[] = "somePath\\cl_cache\\TMP.XXXXXX"; + cache.createUniqueTempFileAndWriteData(tmpFileName, binary, strlen(binary)); auto capturedStderr = ::testing::internal::GetCapturedStderr(); std::string expectedStderrSubstr("[Cache failure]: Creating temporary file name failed! error code:"); @@ -548,7 +550,8 @@ TEST_F(CompilerCacheWindowsTest, givenCreateUniqueTempFileAndWriteDataWhenCreate const char *binary = "12345"; ::testing::internal::CaptureStderr(); - cache.createUniqueTempFileAndWriteData("somePath\\cl_cache\\TMP.XXXXXX", binary, strlen(binary)); + char tmpFileName[] = "somePath\\cl_cache\\TMP.XXXXXX"; + cache.createUniqueTempFileAndWriteData(tmpFileName, binary, strlen(binary)); auto capturedStderr = ::testing::internal::GetCapturedStderr(); std::string expectedStderrSubstr("[Cache failure]: Creating temporary file failed! error code:"); @@ -572,7 +575,8 @@ TEST_F(CompilerCacheWindowsTest, givenCreateUniqueTempFileAndWriteDataWhenWriteF const char *binary = "12345"; ::testing::internal::CaptureStderr(); - cache.createUniqueTempFileAndWriteData("somePath\\cl_cache\\TMP.XXXXXX", binary, strlen(binary)); + char tmpFileName[] = "somePath\\cl_cache\\TMP.XXXXXX"; + cache.createUniqueTempFileAndWriteData(tmpFileName, binary, strlen(binary)); auto capturedStderr = ::testing::internal::GetCapturedStderr(); std::string expectedStderrSubstr("[Cache failure]: Writing to temporary file failed! error code:"); @@ -597,7 +601,8 @@ TEST_F(CompilerCacheWindowsTest, givenCreateUniqueTempFileAndWriteDataWhenWriteF const char *binary = "12345"; SysCalls::writeFileNumberOfBytesWritten = static_cast(strlen(binary)) - 1; ::testing::internal::CaptureStderr(); - cache.createUniqueTempFileAndWriteData("somePath\\cl_cache\\TMP.XXXXXX", binary, strlen(binary)); + char tmpFileName[] = "somePath\\cl_cache\\TMP.XXXXXX"; + cache.createUniqueTempFileAndWriteData(tmpFileName, binary, strlen(binary)); auto capturedStderr = ::testing::internal::GetCapturedStderr(); std::stringstream expectedStderrSubstr; diff --git a/shared/test/unit_test/os_interface/windows/adapter_info_tests.cpp b/shared/test/unit_test/os_interface/windows/adapter_info_tests.cpp index 3058b1871c..729a1a6d1b 100644 --- a/shared/test/unit_test/os_interface/windows/adapter_info_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/adapter_info_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -79,7 +79,7 @@ TEST(DxCoreAdapterFactory, whenSupportedThenGiveAccessToUnderlyingAdapterDesc) { EXPECT_TRUE(retreivedAdapterDesc); EXPECT_EQ(NEO::AdapterFactory::AdapterDesc::Type::Hardware, adapterDesc.type); EXPECT_EQ(0x1234U, adapterDesc.deviceId); - EXPECT_EQ(0x1234U, adapterDesc.luid.HighPart); + EXPECT_EQ(0x1234, adapterDesc.luid.HighPart); EXPECT_EQ(0U, adapterDesc.luid.LowPart); EXPECT_STREQ("Intel", adapterDesc.driverDescription.c_str()); } @@ -121,7 +121,7 @@ TEST(DxgiAdapterFactory, whenSupportedThenGiveAccessToUnderlyingAdapterDesc) { EXPECT_TRUE(retreivedAdapterDesc); EXPECT_EQ(NEO::AdapterFactory::AdapterDesc::Type::Unknown, adapterDesc.type); EXPECT_EQ(0x1234U, adapterDesc.deviceId); - EXPECT_EQ(0x1234U, adapterDesc.luid.HighPart); + EXPECT_EQ(0x1234, adapterDesc.luid.HighPart); EXPECT_EQ(0U, adapterDesc.luid.LowPart); EXPECT_STREQ("Intel", adapterDesc.driverDescription.c_str()); } diff --git a/shared/test/unit_test/os_interface/windows/device_command_stream_tests.cpp b/shared/test/unit_test/os_interface/windows/device_command_stream_tests.cpp index 4182669e4e..a2d9d4e2c4 100644 --- a/shared/test/unit_test/os_interface/windows/device_command_stream_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/device_command_stream_tests.cpp @@ -125,7 +125,7 @@ struct MockWddmCsr : public WddmCommandStreamReceiver { directSubmissionControllerStarted = true; } int flushCalledCount = 0; - std::unique_ptr recordedCommandBuffer = nullptr; + std::unique_ptr recordedCommandBuffer; bool callParentInitDirectSubmission = true; bool initBlitterDirectSubmission = false; diff --git a/shared/test/unit_test/os_interface/windows/os_library_win_tests.cpp b/shared/test/unit_test/os_interface/windows/os_library_win_tests.cpp index ec4915dbd8..865d2755be 100644 --- a/shared/test/unit_test/os_interface/windows/os_library_win_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/os_library_win_tests.cpp @@ -21,13 +21,13 @@ using namespace NEO; class OsLibraryBackup : public Windows::OsLibrary { using Type = decltype(Windows::OsLibrary::loadLibraryExA); - using BackupType = typename VariableBackup; + using BackupType = VariableBackup; using ModuleNameType = decltype(Windows::OsLibrary::getModuleFileNameA); - using ModuleNameBackupType = typename VariableBackup; + using ModuleNameBackupType = VariableBackup; using SystemDirectoryType = decltype(Windows::OsLibrary::getSystemDirectoryA); - using SystemDirectoryBackupType = typename VariableBackup; + using SystemDirectoryBackupType = VariableBackup; struct Backup { std::unique_ptr bkp1 = nullptr; @@ -119,4 +119,4 @@ TEST(OSLibraryWinTest, GivenNoLastErrorOnWindowsThenErrorStringisEmpty) { lib->getLastErrorString(&errorValue); EXPECT_TRUE(errorValue.empty()); lib->getLastErrorString(nullptr); -} \ No newline at end of file +} diff --git a/shared/test/unit_test/os_interface/windows/os_time_win_tests.cpp b/shared/test/unit_test/os_interface/windows/os_time_win_tests.cpp index a416343e1c..57ac38269b 100644 --- a/shared/test/unit_test/os_interface/windows/os_time_win_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/os_time_win_tests.cpp @@ -18,7 +18,7 @@ using namespace NEO; -LARGE_INTEGER valueToSet = {0}; +LARGE_INTEGER valueToSet = {}; BOOL WINAPI QueryPerformanceCounterMock( _Out_ LARGE_INTEGER *lpPerformanceCount) { @@ -140,7 +140,7 @@ TEST_F(OSTimeWinTest, givenOsTimeWinWhenGetCpuRawTimestampIsCalledThenReturnsNon TEST_F(OSTimeWinTest, givenHighValueOfCpuTimestampWhenItIsObtainedThenItHasProperValue) { osTime->overrideQueryPerformanceCounterFunction(QueryPerformanceCounterMock); - LARGE_INTEGER frequency = {0}; + LARGE_INTEGER frequency = {}; frequency.QuadPart = 190457; osTime->setFrequency(frequency); valueToSet.QuadPart = 700894514854; @@ -159,7 +159,7 @@ TEST(OSTimeWinTests, givenNoOSInterfaceWhenGetCpuTimeThenReturnsSuccess) { } TEST(OSTimeWinTests, givenNoOSInterfaceWhenGetGpuCpuTimeThenReturnsSuccess) { - TimeStampData gpuCpuTime = {0}; + TimeStampData gpuCpuTime = {}; auto osTime(OSTime::create(nullptr)); auto success = osTime->getGpuCpuTime(&gpuCpuTime); EXPECT_TRUE(success); @@ -171,8 +171,8 @@ TEST(OSTimeWinTests, givenOSInterfaceWhenGetGpuCpuTimeThenReturnsSuccess) { MockExecutionEnvironment executionEnvironment; auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0]; auto wddm = new WddmMock(rootDeviceEnvironment); - TimeStampData gpuCpuTime01 = {0}; - TimeStampData gpuCpuTime02 = {0}; + TimeStampData gpuCpuTime01 = {}; + TimeStampData gpuCpuTime02 = {}; std::unique_ptr osInterface(new OSInterface()); osInterface->setDriverModel(std::unique_ptr(wddm)); auto osTime = OSTime::create(osInterface.get()); diff --git a/shared/test/unit_test/os_interface/windows/registry_reader_tests.cpp b/shared/test/unit_test/os_interface/windows/registry_reader_tests.cpp index 5bde06672b..f975a74a02 100644 --- a/shared/test/unit_test/os_interface/windows/registry_reader_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/registry_reader_tests.cpp @@ -68,14 +68,14 @@ TEST_F(RegistryReaderTest, givenRegistryReaderWhenItIsCreatedWithRegKeySpecified } TEST_F(RegistryReaderTest, givenRegistryReaderWhenEnvironmentVariableExistsThenReturnCorrectValue) { - char *envVar = "TestedEnvironmentVariable"; + const char *envVar = "TestedEnvironmentVariable"; std::string value = "defaultValue"; TestedRegistryReader registryReader(""); EXPECT_EQ("TestedEnvironmentVariableValue", registryReader.getSetting(envVar, value)); } TEST_F(RegistryReaderTest, givenRegistryReaderWhenEnvironmentVariableExistsThenReturnCorrectValuePrefix) { - char *envVar = "TestedEnvironmentVariable"; + const char *envVar = "TestedEnvironmentVariable"; std::string value = "defaultValue"; TestedRegistryReader registryReader(""); DebugVarPrefix type = DebugVarPrefix::None; @@ -84,7 +84,7 @@ TEST_F(RegistryReaderTest, givenRegistryReaderWhenEnvironmentVariableExistsThenR } TEST_F(RegistryReaderTest, givenRegistryReaderWhenPrefixedEnvironmentVariableExistsThenReturnCorrectValue) { - char *envVar = "TestedEnvironmentVariableWithPrefix"; + const char *envVar = "TestedEnvironmentVariableWithPrefix"; std::string value = "defaultValue"; TestedRegistryReader registryReader(""); DebugVarPrefix type = DebugVarPrefix::None; @@ -93,14 +93,14 @@ TEST_F(RegistryReaderTest, givenRegistryReaderWhenPrefixedEnvironmentVariableExi } TEST_F(RegistryReaderTest, givenRegistryReaderWhenEnvironmentIntVariableExistsThenReturnCorrectValue) { - char *envVar = "TestedEnvironmentIntVariable"; + const char *envVar = "TestedEnvironmentIntVariable"; int32_t value = -1; TestedRegistryReader registryReader(""); EXPECT_EQ(1234, registryReader.getSetting(envVar, value)); } TEST_F(RegistryReaderTest, givenRegistryReaderWhenEnvironmentIntVariableExistsThenReturnCorrectValuePrefix) { - char *envVar = "TestedEnvironmentIntVariable"; + const char *envVar = "TestedEnvironmentIntVariable"; int32_t value = -1; TestedRegistryReader registryReader(""); DebugVarPrefix type = DebugVarPrefix::None; @@ -109,7 +109,7 @@ TEST_F(RegistryReaderTest, givenRegistryReaderWhenEnvironmentIntVariableExistsTh } TEST_F(RegistryReaderTest, givenRegistryReaderWhenPrefixedEnvironmentIntVariableExistsThenReturnCorrectValue) { - char *envVar = "TestedEnvironmentIntVariableWithPrefix"; + const char *envVar = "TestedEnvironmentIntVariableWithPrefix"; int32_t value = -1; TestedRegistryReader registryReader(""); DebugVarPrefix type = DebugVarPrefix::None; @@ -155,7 +155,7 @@ TEST_F(DebugReaderWithRegistryAndEnvTest, givenIntDebugKeyWhenReadFromRegistrySu SysCalls::regOpenKeySuccessCount = 1u; SysCalls::regQueryValueSuccessCount = 1u; - EXPECT_EQ(1u, registryReader.getSetting("settingSourceInt", 0)); + EXPECT_EQ(1, registryReader.getSetting("settingSourceInt", 0)); } TEST_F(DebugReaderWithRegistryAndEnvTest, givenIntDebugKeyWhenReadFromRegistrySucceedsThenReturnObtainedValuePrefix) { @@ -163,7 +163,7 @@ TEST_F(DebugReaderWithRegistryAndEnvTest, givenIntDebugKeyWhenReadFromRegistrySu SysCalls::regQueryValueSuccessCount = 1u; DebugVarPrefix type = DebugVarPrefix::None; - EXPECT_EQ(1u, registryReader.getSetting("settingSourceInt", 0, type)); + EXPECT_EQ(1, registryReader.getSetting("settingSourceInt", 0, type)); EXPECT_EQ(DebugVarPrefix::None, type); } @@ -171,7 +171,8 @@ TEST_F(DebugReaderWithRegistryAndEnvTest, givenInt64DebugKeyWhenReadFromRegistry SysCalls::regOpenKeySuccessCount = 1u; SysCalls::regQueryValueSuccessCount = 1u; - EXPECT_EQ(0xeeeeeeee, registryReader.getSetting("settingSourceInt64", 0)); + int expectedValue = 0xeeeeeeee; + EXPECT_EQ(expectedValue, registryReader.getSetting("settingSourceInt64", 0)); } TEST_F(DebugReaderWithRegistryAndEnvTest, givenInt64DebugKeyWhenReadFromRegistrySucceedsThenReturnObtainedValuePrefix) { @@ -179,7 +180,8 @@ TEST_F(DebugReaderWithRegistryAndEnvTest, givenInt64DebugKeyWhenReadFromRegistry SysCalls::regQueryValueSuccessCount = 1u; DebugVarPrefix type = DebugVarPrefix::None; - EXPECT_EQ(0xeeeeeeee, registryReader.getSetting("settingSourceInt64", 0, type)); + int expectedValue = 0xeeeeeeee; + EXPECT_EQ(expectedValue, registryReader.getSetting("settingSourceInt64", 0, type)); EXPECT_EQ(DebugVarPrefix::None, type); } @@ -187,7 +189,7 @@ TEST_F(DebugReaderWithRegistryAndEnvTest, givenIntDebugKeyWhenQueryValueFailsThe SysCalls::regOpenKeySuccessCount = 1u; SysCalls::regQueryValueSuccessCount = 0u; - EXPECT_EQ(2u, registryReader.getSetting("settingSourceInt", 0)); + EXPECT_EQ(2, registryReader.getSetting("settingSourceInt", 0)); } TEST_F(DebugReaderWithRegistryAndEnvTest, givenIntDebugKeyWhenQueryValueFailsThenObtainValueFromEnvPrefix) { @@ -195,7 +197,7 @@ TEST_F(DebugReaderWithRegistryAndEnvTest, givenIntDebugKeyWhenQueryValueFailsThe SysCalls::regQueryValueSuccessCount = 0u; DebugVarPrefix type = DebugVarPrefix::None; - EXPECT_EQ(2u, registryReader.getSetting("settingSourceInt", 0, type)); + EXPECT_EQ(2, registryReader.getSetting("settingSourceInt", 0, type)); EXPECT_EQ(DebugVarPrefix::None, type); } @@ -203,7 +205,7 @@ TEST_F(DebugReaderWithRegistryAndEnvTest, givenIntDebugKeyWhenOpenKeyFailsThenOb SysCalls::regOpenKeySuccessCount = 0u; SysCalls::regQueryValueSuccessCount = 0u; - EXPECT_EQ(2u, registryReader.getSetting("settingSourceInt", 0)); + EXPECT_EQ(2, registryReader.getSetting("settingSourceInt", 0)); } TEST_F(DebugReaderWithRegistryAndEnvTest, givenIntDebugKeyWhenOpenKeyFailsThenObtainValueFromEnvPrefix) { @@ -211,7 +213,7 @@ TEST_F(DebugReaderWithRegistryAndEnvTest, givenIntDebugKeyWhenOpenKeyFailsThenOb SysCalls::regQueryValueSuccessCount = 0u; DebugVarPrefix type = DebugVarPrefix::None; - EXPECT_EQ(2u, registryReader.getSetting("settingSourceInt", 0, type)); + EXPECT_EQ(2, registryReader.getSetting("settingSourceInt", 0, type)); EXPECT_EQ(DebugVarPrefix::None, type); } @@ -525,4 +527,4 @@ TEST_F(DebugReaderWithRegistryAndEnvTest, givenSetProcessNameWhenReadFromEnviron EXPECT_STREQ("./tested_cl_cache_dir", cacheDir2.c_str()); EXPECT_EQ(DebugVarPrefix::None, type); } -} // namespace NEO \ No newline at end of file +} // namespace NEO diff --git a/shared/test/unit_test/os_interface/windows/wddm20_tests.cpp b/shared/test/unit_test/os_interface/windows/wddm20_tests.cpp index fdbffa44d1..2719f80cce 100644 --- a/shared/test/unit_test/os_interface/windows/wddm20_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/wddm20_tests.cpp @@ -432,8 +432,8 @@ TEST_F(WddmTestWithMockGdiDll, givenShareableAllocationWhenCreateThenCreateResou auto status = wddm->createAllocation(&allocation); EXPECT_EQ(STATUS_SUCCESS, status); auto passedCreateAllocation = getMockAllocationFcn(); - EXPECT_EQ(TRUE, passedCreateAllocation->Flags.CreateShared); - EXPECT_EQ(TRUE, passedCreateAllocation->Flags.CreateResource); + EXPECT_EQ(1u, passedCreateAllocation->Flags.CreateShared); + EXPECT_EQ(1u, passedCreateAllocation->Flags.CreateResource); wddm->destroyAllocation(&allocation, nullptr); } @@ -1726,4 +1726,4 @@ TEST_F(WddmTestWithMockGdiDll, givenNonZeroMaxDualSubSlicesSupportedWhenQueryAda EXPECT_TRUE(wddm->queryAdapterInfo()); EXPECT_EQ(expectedMaxDSS, wddm->getGtSysInfo()->MaxDualSubSlicesSupported); EXPECT_NE(maxSS / 2, wddm->getGtSysInfo()->MaxDualSubSlicesSupported); -} \ No newline at end of file +} diff --git a/shared/test/unit_test/os_interface/windows/wddm_kmdaf_listener_tests.cpp b/shared/test/unit_test/os_interface/windows/wddm_kmdaf_listener_tests.cpp index cc006eef0d..0953617fd7 100644 --- a/shared/test/unit_test/os_interface/windows/wddm_kmdaf_listener_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/wddm_kmdaf_listener_tests.cpp @@ -85,8 +85,8 @@ TEST_F(WddmKmDafListenerTest, givenInvalidAllocationWhenLockResourceFailsThenKmD EXPECT_FALSE(wddmWithKmDafMock->getKmDafListenerMock().notifyLockParametrization.ftrKmdDaf); EXPECT_EQ(0u, wddmWithKmDafMock->getKmDafListenerMock().notifyLockParametrization.hAdapter); EXPECT_EQ(0u, wddmWithKmDafMock->getKmDafListenerMock().notifyLockParametrization.hDevice); - EXPECT_EQ(0, wddmWithKmDafMock->getKmDafListenerMock().notifyLockParametrization.hAllocation); - EXPECT_EQ(0, wddmWithKmDafMock->getKmDafListenerMock().notifyLockParametrization.pLockFlags); + EXPECT_EQ(0u, wddmWithKmDafMock->getKmDafListenerMock().notifyLockParametrization.hAllocation); + EXPECT_EQ(0u, wddmWithKmDafMock->getKmDafListenerMock().notifyLockParametrization.pLockFlags); } TEST_F(WddmKmDafListenerTest, givenWddmWhenUnlockResourceIsCalledThenKmDafListenerNotifyUnlockIsFedWithCorrectParams) { diff --git a/shared/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp b/shared/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp index 30ac05aab5..e9a2486b17 100644 --- a/shared/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/wddm_residency_controller_tests.cpp @@ -934,7 +934,7 @@ TEST_F(WddmResidencyControllerLockTest, givenPeriodicTrimWhenTrimmingResidencyTh trimNotification.NumBytesToTrim = 0; residencyController->trimResidency(trimNotification.Flags, trimNotification.NumBytesToTrim); - EXPECT_EQ(1, residencyController->acquireLockCallCount); + EXPECT_EQ(1u, residencyController->acquireLockCallCount); } TEST_F(WddmResidencyControllerLockTest, givenTrimToBudgetWhenTrimmingResidencyThenLockOnce) { @@ -943,7 +943,7 @@ TEST_F(WddmResidencyControllerLockTest, givenTrimToBudgetWhenTrimmingResidencyTh trimNotification.NumBytesToTrim = 0; residencyController->trimResidency(trimNotification.Flags, trimNotification.NumBytesToTrim); - EXPECT_EQ(1, residencyController->acquireLockCallCount); + EXPECT_EQ(1u, residencyController->acquireLockCallCount); } TEST_F(WddmResidencyControllerLockTest, givenPeriodicTrimAndTrimToBudgetWhenTrimmingResidencyThenLockTwice) { @@ -953,7 +953,7 @@ TEST_F(WddmResidencyControllerLockTest, givenPeriodicTrimAndTrimToBudgetWhenTrim trimNotification.NumBytesToTrim = 0; residencyController->trimResidency(trimNotification.Flags, trimNotification.NumBytesToTrim); - EXPECT_EQ(2, residencyController->acquireLockCallCount); + EXPECT_EQ(2u, residencyController->acquireLockCallCount); } TEST_F(WddmResidencyControllerWithGdiAndMemoryManagerTest, WhenMakingResidentResidencyAllocationsThenAllAllocationsAreMarked) { @@ -1099,8 +1099,8 @@ TEST_F(WddmResidencyControllerWithMockWddmTest, givenAllocationPackPassedWhenCal EXPECT_TRUE(result); EXPECT_EQ(2 * EngineLimits::maxHandleCount, wddm->makeResidentResult.handleCount); EXPECT_EQ(false, wddm->makeResidentResult.cantTrimFurther); - EXPECT_EQ(1, wddm->makeResidentResult.handlePack[0 * EngineLimits::maxHandleCount]); - EXPECT_EQ(2, wddm->makeResidentResult.handlePack[1 * EngineLimits::maxHandleCount]); + EXPECT_EQ(1u, wddm->makeResidentResult.handlePack[0 * EngineLimits::maxHandleCount]); + EXPECT_EQ(2u, wddm->makeResidentResult.handlePack[1 * EngineLimits::maxHandleCount]); EXPECT_EQ(1u, wddm->makeResidentResult.called); } @@ -1139,7 +1139,7 @@ TEST_F(WddmResidencyControllerWithMockWddmTest, givenMakeResidentFailsWhenCallin } struct WddmMakeResidentMock : public WddmMock { - WddmMakeResidentMock::WddmMakeResidentMock(RootDeviceEnvironment &rootDeviceEnvironment) : WddmMock(rootDeviceEnvironment){}; + WddmMakeResidentMock(RootDeviceEnvironment &rootDeviceEnvironment) : WddmMock(rootDeviceEnvironment){}; bool makeResident(const D3DKMT_HANDLE *handles, uint32_t count, bool cantTrimFurther, uint64_t *numberOfBytesToTrim, size_t totalSize) override { *numberOfBytesToTrim = makeResidentNumberOfBytesToTrim; diff --git a/shared/test/unit_test/os_interface/windows/wddm_tests.cpp b/shared/test/unit_test/os_interface/windows/wddm_tests.cpp index bc2fe152fd..80703d0ba3 100644 --- a/shared/test/unit_test/os_interface/windows/wddm_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/wddm_tests.cpp @@ -31,7 +31,7 @@ TEST_F(WddmTests, whenCreatingAllocation64kThenDoNotCreateResource) { EXPECT_TRUE(wddm->createAllocation(&gmm, handle)); auto gdiParam = getMockAllocationFcn(); - EXPECT_EQ(FALSE, gdiParam->Flags.CreateResource); + EXPECT_EQ(0u, gdiParam->Flags.CreateResource); EXPECT_TRUE(wddm->destroyAllocations(&handle, 1, 0)); } diff --git a/shared/test/unit_test/page_fault_manager/windows/cpu_page_fault_manager_windows_tests.cpp b/shared/test/unit_test/page_fault_manager/windows/cpu_page_fault_manager_windows_tests.cpp index e31558eb30..d78b81318a 100644 --- a/shared/test/unit_test/page_fault_manager/windows/cpu_page_fault_manager_windows_tests.cpp +++ b/shared/test/unit_test/page_fault_manager/windows/cpu_page_fault_manager_windows_tests.cpp @@ -5,12 +5,12 @@ * */ +#include "shared/source/os_interface/windows/windows_wrapper.h" #include "shared/source/page_fault_manager/windows/cpu_page_fault_manager_windows.h" #include "shared/test/common/fixtures/cpu_page_fault_manager_tests_fixture.h" #include "shared/test/common/mocks/mock_cpu_page_fault_manager.h" #include "gtest/gtest.h" -#include using namespace NEO; diff --git a/shared/wsl_compute_helper/source/gmm_resource_info_struct.h b/shared/wsl_compute_helper/source/gmm_resource_info_struct.h index 5ed8e5a64a..e13f8a5429 100644 --- a/shared/wsl_compute_helper/source/gmm_resource_info_struct.h +++ b/shared/wsl_compute_helper/source/gmm_resource_info_struct.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -9,11 +9,8 @@ // gmm enforces include order // clang-format off -#ifndef WDDM_LINUX -# include -# include "d3dkmthk.h" -#else -# include "shared/source/os_interface/windows/windows_wrapper.h" +#include "shared/source/os_interface/windows/windows_wrapper.h" +#ifdef WDDM_LINUX # include "umKmInc/sharedata.h" # ifdef LHDM # undef LHDM