mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
fix: fix compilation error in clang on Windows (2/n)
Signed-off-by: Jablonski, Mateusz <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
9cd395b8a4
commit
ac5f64f5c6
@@ -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) {
|
||||
|
||||
@@ -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<void *>(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<void *>(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<void *>(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<void *>(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<void *>(userFunc), "args", args,
|
||||
"cbArgs", cbArgs, "numMemObjects", numMemObjects, "memList", memList, "argsMemLoc", argsMemLoc,
|
||||
"numEventsInWaitList", numEventsInWaitList,
|
||||
"eventWaitList", getClFileLogger().getEvents(reinterpret_cast<const uintptr_t *>(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<void *>(pfnFreeFunc),
|
||||
"userData", userData,
|
||||
"numEventsInWaitList", numEventsInWaitList,
|
||||
"eventWaitList", getClFileLogger().getEvents(reinterpret_cast<const uintptr_t *>(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<void *>(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<void *>(pfnNotify),
|
||||
"userData", userData);
|
||||
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
|
||||
@@ -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 <d3d10_1.h>
|
||||
|
||||
#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
|
||||
|
||||
@@ -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<D3DTypesHelper::D3D10>;
|
||||
template class D3DSharingFunctions<D3DTypesHelper::D3D11>;
|
||||
template class NEO::D3DSharingFunctions<D3DTypesHelper::D3D10>;
|
||||
template class NEO::D3DSharingFunctions<D3DTypesHelper::D3D11>;
|
||||
|
||||
template <>
|
||||
const uint32_t D3DSharingFunctions<D3DTypesHelper::D3D10>::sharingId = SharingType::D3D10_SHARING;
|
||||
template <>
|
||||
const uint32_t D3DSharingFunctions<D3DTypesHelper::D3D11>::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 <typename D3D>
|
||||
void D3DSharingFunctions<D3D>::createQuery(D3DQuery **query) {
|
||||
D3DQueryDesc desc = {};
|
||||
@@ -240,6 +124,123 @@ std::vector<DXGI_FORMAT> &D3DSharingFunctions<D3D>::retrieveTextureFormats(cl_me
|
||||
std::vector<DXGI_FORMAT> &cached_formats = cached->second;
|
||||
std::vector<DXGI_FORMAT> 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;
|
||||
|
||||
@@ -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<D3DTypesHelper::D3D9>;
|
||||
template class NEO::D3DSharingFunctions<D3DTypesHelper::D3D9>;
|
||||
template <>
|
||||
const uint32_t D3DSharingFunctions<D3DTypesHelper::D3D9>::sharingId = SharingType::D3D9_SHARING;
|
||||
|
||||
template <>
|
||||
@@ -60,6 +61,7 @@ bool D3DSharingFunctions<D3DTypesHelper::D3D9>::checkFormatSupport(DXGI_FORMAT f
|
||||
return false;
|
||||
}
|
||||
|
||||
template <>
|
||||
cl_int D3DSharingFunctions<D3DTypesHelper::D3D9>::validateFormatSupport(DXGI_FORMAT format, cl_mem_object_type type) {
|
||||
return CL_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -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 <d3d10_1.h>
|
||||
|
||||
#include <CL/cl.h>
|
||||
#include <d3d11.h>
|
||||
#include <d3d9.h>
|
||||
|
||||
#if __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
|
||||
@@ -60,6 +60,6 @@ class D3DBuffer : public D3DSharing<D3D> {
|
||||
|
||||
protected:
|
||||
D3DBuffer(Context *context, D3DBufferObj *d3dBuffer, D3DBufferObj *bufferStaging, bool sharedResource)
|
||||
: D3DSharing(context, d3dBuffer, bufferStaging, 0, sharedResource){};
|
||||
: D3DSharing<D3D>(context, d3dBuffer, bufferStaging, 0, sharedResource){};
|
||||
};
|
||||
} // namespace NEO
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
template class D3DSharing<D3DTypesHelper::D3D9>;
|
||||
template class D3DSharing<D3DTypesHelper::D3D10>;
|
||||
template class D3DSharing<D3DTypesHelper::D3D11>;
|
||||
template class NEO::D3DSharing<D3DTypesHelper::D3D9>;
|
||||
template class NEO::D3DSharing<D3DTypesHelper::D3D10>;
|
||||
template class NEO::D3DSharing<D3DTypesHelper::D3D11>;
|
||||
|
||||
template <typename D3D>
|
||||
D3DSharing<D3D>::D3DSharing(Context *context, D3DResource *resource, D3DResource *resourceStaging, unsigned int subresource, bool sharedResource)
|
||||
@@ -75,7 +75,7 @@ void D3DSharing<D3D>::updateImgInfoAndDesc(Gmm *gmm, ImageInfo &imgInfo, ImagePl
|
||||
}
|
||||
|
||||
template <typename D3D>
|
||||
const ClSurfaceFormatInfo *D3DSharing<D3D>::findSurfaceFormatInfo(GMM_RESOURCE_FORMAT_ENUM gmmFormat, cl_mem_flags flags, bool supportsOcl20Features, bool packedSupported) {
|
||||
const ClSurfaceFormatInfo *D3DSharing<D3D>::findSurfaceFormatInfo(int gmmFormat, cl_mem_flags flags, bool supportsOcl20Features, bool packedSupported) {
|
||||
ArrayRef<const ClSurfaceFormatInfo> formats = SurfaceFormats::surfaceFormats(flags, supportsOcl20Features);
|
||||
for (auto &format : formats) {
|
||||
if (gmmFormat == format.surfaceFormat.gmmSurfaceFormat) {
|
||||
|
||||
@@ -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 <mutex>
|
||||
|
||||
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:
|
||||
|
||||
@@ -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<D3DFORMAT>(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<D3DFORMAT>(MAKEFOURCC('Y', 'V', '1', '2')):
|
||||
case MAKEFOURCC('Y', 'V', '1', '2'):
|
||||
switch (plane) {
|
||||
case 0:
|
||||
imagePlane = ImagePlane::PLANE_Y;
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
template class D3DTexture<D3DTypesHelper::D3D10>;
|
||||
template class D3DTexture<D3DTypesHelper::D3D11>;
|
||||
template class NEO::D3DTexture<D3DTypesHelper::D3D10>;
|
||||
template class NEO::D3DTexture<D3DTypesHelper::D3D11>;
|
||||
|
||||
template <typename D3D>
|
||||
Image *D3DTexture<D3D>::create2d(Context *context, D3DTexture2d *d3dTexture, cl_mem_flags flags, cl_uint subresource, cl_int *retCode) {
|
||||
|
||||
@@ -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<D3D> {
|
||||
|
||||
protected:
|
||||
D3DTexture(Context *context, D3DResource *d3dTexture, cl_uint subresource, D3DResource *textureStaging, bool sharedResource)
|
||||
: D3DSharing(context, d3dTexture, textureStaging, subresource, sharedResource){};
|
||||
: D3DSharing<D3D>(context, d3dTexture, textureStaging, subresource, sharedResource){};
|
||||
};
|
||||
} // namespace NEO
|
||||
|
||||
@@ -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<D3DTypesHelper::D3D9>::processProperties(cl_context_properties &propertyType, cl_context_properties &propertyValue) {
|
||||
if (contextData.get() == nullptr) {
|
||||
contextData = std::make_unique<D3DCreateContextProperties<D3DTypesHelper::D3D9>>();
|
||||
@@ -42,6 +43,7 @@ bool D3DSharingContextBuilder<D3DTypesHelper::D3D9>::processProperties(cl_contex
|
||||
return false;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool D3DSharingContextBuilder<D3DTypesHelper::D3D10>::processProperties(cl_context_properties &propertyType, cl_context_properties &propertyValue) {
|
||||
if (contextData.get() == nullptr) {
|
||||
contextData = std::make_unique<D3DCreateContextProperties<D3DTypesHelper::D3D10>>();
|
||||
@@ -56,6 +58,7 @@ bool D3DSharingContextBuilder<D3DTypesHelper::D3D10>::processProperties(cl_conte
|
||||
return false;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool D3DSharingContextBuilder<D3DTypesHelper::D3D11>::processProperties(cl_context_properties &propertyType, cl_context_properties &propertyValue) {
|
||||
if (contextData.get() == nullptr) {
|
||||
contextData = std::make_unique<D3DCreateContextProperties<D3DTypesHelper::D3D11>>();
|
||||
@@ -99,18 +102,22 @@ std::unique_ptr<SharingContextBuilder> D3DSharingBuilderFactory<D3D>::createCont
|
||||
return std::make_unique<D3DSharingContextBuilder<D3D>>();
|
||||
};
|
||||
|
||||
template <>
|
||||
std::string D3DSharingBuilderFactory<D3DTypesHelper::D3D9>::getExtensions(DriverInfo *driverInfo) {
|
||||
return extensionEnabled ? "cl_intel_dx9_media_sharing cl_khr_dx9_media_sharing " : "";
|
||||
}
|
||||
|
||||
template <>
|
||||
std::string D3DSharingBuilderFactory<D3DTypesHelper::D3D10>::getExtensions(DriverInfo *driverInfo) {
|
||||
return extensionEnabled ? "cl_khr_d3d10_sharing " : "";
|
||||
}
|
||||
|
||||
template <>
|
||||
std::string D3DSharingBuilderFactory<D3DTypesHelper::D3D11>::getExtensions(DriverInfo *driverInfo) {
|
||||
return extensionEnabled ? "cl_khr_d3d11_sharing cl_intel_d3d11_nv12_media_sharing " : "";
|
||||
}
|
||||
|
||||
template <>
|
||||
void D3DSharingBuilderFactory<D3DTypesHelper::D3D9>::fillGlobalDispatchTable() {
|
||||
icdGlobalDispatchTable.clGetDeviceIDsFromDX9MediaAdapterKHR = clGetDeviceIDsFromDX9MediaAdapterKHR;
|
||||
icdGlobalDispatchTable.clCreateFromDX9MediaSurfaceKHR = clCreateFromDX9MediaSurfaceKHR;
|
||||
@@ -123,6 +130,7 @@ void D3DSharingBuilderFactory<D3DTypesHelper::D3D9>::fillGlobalDispatchTable() {
|
||||
crtGlobalDispatchTable.clEnqueueReleaseDX9ObjectsINTEL = clEnqueueReleaseDX9ObjectsINTEL;
|
||||
}
|
||||
|
||||
template <>
|
||||
void D3DSharingBuilderFactory<D3DTypesHelper::D3D10>::fillGlobalDispatchTable() {
|
||||
icdGlobalDispatchTable.clCreateFromD3D10BufferKHR = clCreateFromD3D10BufferKHR;
|
||||
icdGlobalDispatchTable.clCreateFromD3D10Texture2DKHR = clCreateFromD3D10Texture2DKHR;
|
||||
@@ -132,6 +140,7 @@ void D3DSharingBuilderFactory<D3DTypesHelper::D3D10>::fillGlobalDispatchTable()
|
||||
icdGlobalDispatchTable.clGetDeviceIDsFromD3D10KHR = clGetDeviceIDsFromD3D10KHR;
|
||||
}
|
||||
|
||||
template <>
|
||||
void D3DSharingBuilderFactory<D3DTypesHelper::D3D11>::fillGlobalDispatchTable() {
|
||||
icdGlobalDispatchTable.clCreateFromD3D11BufferKHR = clCreateFromD3D11BufferKHR;
|
||||
icdGlobalDispatchTable.clCreateFromD3D11Texture2DKHR = clCreateFromD3D11Texture2DKHR;
|
||||
@@ -141,6 +150,7 @@ void D3DSharingBuilderFactory<D3DTypesHelper::D3D11>::fillGlobalDispatchTable()
|
||||
icdGlobalDispatchTable.clGetDeviceIDsFromD3D11KHR = clGetDeviceIDsFromD3D11KHR;
|
||||
}
|
||||
|
||||
template <>
|
||||
void *D3DSharingBuilderFactory<D3DTypesHelper::D3D9>::getExtensionFunctionAddress(const std::string &functionName) {
|
||||
if (DebugManager.flags.EnableFormatQuery.get() &&
|
||||
functionName == "clGetSupportedDX9MediaSurfaceFormatsINTEL") {
|
||||
@@ -149,6 +159,7 @@ void *D3DSharingBuilderFactory<D3DTypesHelper::D3D9>::getExtensionFunctionAddres
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
void *D3DSharingBuilderFactory<D3DTypesHelper::D3D10>::getExtensionFunctionAddress(const std::string &functionName) {
|
||||
if (DebugManager.flags.EnableFormatQuery.get() &&
|
||||
functionName == "clGetSupportedD3D10TextureFormatsINTEL") {
|
||||
@@ -157,6 +168,7 @@ void *D3DSharingBuilderFactory<D3DTypesHelper::D3D10>::getExtensionFunctionAddre
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
void *D3DSharingBuilderFactory<D3DTypesHelper::D3D11>::getExtensionFunctionAddress(const std::string &functionName) {
|
||||
if (DebugManager.flags.EnableFormatQuery.get() &&
|
||||
functionName == "clGetSupportedD3D11TextureFormatsINTEL") {
|
||||
@@ -165,15 +177,18 @@ void *D3DSharingBuilderFactory<D3DTypesHelper::D3D11>::getExtensionFunctionAddre
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
void D3DSharingBuilderFactory<D3DTypesHelper::D3D9>::setExtensionEnabled(DriverInfo *driverInfo) {
|
||||
auto driverInfoWin = driverInfo->as<DriverInfoWindows>();
|
||||
extensionEnabled = driverInfo->getMediaSharingSupport() && driverInfoWin->containsSetting(is64bit ? "UserModeDriverName" : "UserModeDriverNameWOW");
|
||||
}
|
||||
|
||||
template <>
|
||||
void D3DSharingBuilderFactory<D3DTypesHelper::D3D10>::setExtensionEnabled(DriverInfo *driverInfo) {
|
||||
extensionEnabled = driverInfo->getMediaSharingSupport();
|
||||
}
|
||||
|
||||
template <>
|
||||
void D3DSharingBuilderFactory<D3DTypesHelper::D3D11>::setExtensionEnabled(DriverInfo *driverInfo) {
|
||||
extensionEnabled = driverInfo->getMediaSharingSupport();
|
||||
}
|
||||
|
||||
@@ -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 <functional>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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 <psapi.h>
|
||||
|
||||
std::string SehException::getExceptionDescription(unsigned int code) {
|
||||
switch (code) {
|
||||
switch (static_cast<long>(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<long>(code) != EXCEPTION_STACK_OVERFLOW) {
|
||||
std::string callstack;
|
||||
|
||||
SehException::getCallStack(code, ep, callstack);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -61,6 +61,7 @@ struct BatchBuffer {
|
||||
|
||||
struct CommandBuffer : public IDNode<CommandBuffer> {
|
||||
CommandBuffer(Device &device);
|
||||
~CommandBuffer() override;
|
||||
ResidencyContainer surfaces;
|
||||
BatchBuffer batchBuffer;
|
||||
void *batchBufferEndLocation = nullptr;
|
||||
|
||||
@@ -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 <set>
|
||||
|
||||
namespace NEO {
|
||||
|
||||
@@ -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<uint64_t>(®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<uint64_t>(&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<NEO::Wddm>();
|
||||
|
||||
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<NEO::Wddm>();
|
||||
|
||||
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<NEO::Wddm>();
|
||||
int val = 0;
|
||||
KM_ESCAPE_INFO escapeInfo = {0};
|
||||
KM_ESCAPE_INFO escapeInfo = {};
|
||||
escapeInfo.KmEuDbgUmdCreateDebugData.DataSize = sizeof(val);
|
||||
escapeInfo.KmEuDbgUmdCreateDebugData.DebugDataType = static_cast<uint32_t>(NEO::DebugDataType::CMD_QUEUE_CREATED);
|
||||
escapeInfo.KmEuDbgUmdCreateDebugData.hElfAddressPtr = reinterpret_cast<uint64_t>(&val);
|
||||
@@ -245,7 +245,7 @@ void DebuggerL0::notifyCommandQueueDestroyed(NEO::Device *deviceIn) {
|
||||
if (--commandQueueCount[0] == 0) {
|
||||
auto pWddm = device->getRootDeviceEnvironment().osInterface->getDriverModel()->as<NEO::Wddm>();
|
||||
int val = 0;
|
||||
KM_ESCAPE_INFO escapeInfo = {0};
|
||||
KM_ESCAPE_INFO escapeInfo = {};
|
||||
escapeInfo.KmEuDbgUmdCreateDebugData.DataSize = sizeof(val);
|
||||
escapeInfo.KmEuDbgUmdCreateDebugData.DebugDataType = static_cast<uint32_t>(NEO::DebugDataType::CMD_QUEUE_DESTROYED);
|
||||
escapeInfo.KmEuDbgUmdCreateDebugData.hElfAddressPtr = reinterpret_cast<uint64_t>(&val);
|
||||
|
||||
@@ -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 <windows.h>
|
||||
#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) {
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -6,7 +6,6 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace NEO {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -7,10 +7,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/os_interface/windows/windows_wrapper.h"
|
||||
#include "shared/source/utilities/debug_settings_reader.h"
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string>
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 <dxcore.h>
|
||||
|
||||
#if __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
static const char *const dXCoreCreateAdapterFactoryFuncName = "DXCoreCreateAdapterFactory";
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -96,7 +96,7 @@ bool OsLibrary::isLoaded() {
|
||||
}
|
||||
|
||||
void *OsLibrary::getProcAddress(const std::string &procName) {
|
||||
return ::GetProcAddress(this->handle, procName.c_str());
|
||||
return reinterpret_cast<void *>(::GetProcAddress(this->handle, procName.c_str()));
|
||||
}
|
||||
|
||||
std::string OsLibrary::getFullPath() {
|
||||
|
||||
@@ -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 <windows.h>
|
||||
#include "shared/source/os_interface/windows/windows_wrapper.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <winsock.h>
|
||||
#include "shared/source/os_interface/windows/windows_wrapper.h"
|
||||
|
||||
@@ -25,7 +25,7 @@ std::unique_ptr<PerformanceCounters> PerformanceCounters::create(Device *device)
|
||||
|
||||
counter->clientData.Windows.Adapter = reinterpret_cast<void *>(static_cast<UINT_PTR>(wddm->getAdapter()));
|
||||
counter->clientData.Windows.Device = reinterpret_cast<void *>(static_cast<UINT_PTR>(wddm->getDeviceHandle()));
|
||||
counter->clientData.Windows.Escape = wddm->getEscapeHandle();
|
||||
counter->clientData.Windows.Escape = reinterpret_cast<void *>(wddm->getEscapeHandle());
|
||||
counter->clientData.Windows.KmdInstrumentationEnabled = device->getHardwareInfo().capabilityTable.instrumentationEnabled;
|
||||
counter->contextData.ClientData = &counter->clientData;
|
||||
counter->clientType.Gen = static_cast<MetricsLibraryApi::ClientGen>(gfxCoreHelper.getMetricsLibraryGenId());
|
||||
|
||||
@@ -31,7 +31,7 @@ class DxgiAdapterFactory : public AdapterFactory {
|
||||
return nullptr != adapterFactory;
|
||||
}
|
||||
|
||||
uint32_t getNumAdaptersInSnapshot() {
|
||||
uint32_t getNumAdaptersInSnapshot() override {
|
||||
return static_cast<uint32_t>(adaptersInSnapshot.size());
|
||||
}
|
||||
|
||||
|
||||
@@ -7,11 +7,24 @@
|
||||
|
||||
#pragma once
|
||||
#if _WIN32
|
||||
#include <windows.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"
|
||||
#define UNICODE
|
||||
#endif
|
||||
|
||||
#include <Windows.h>
|
||||
|
||||
#include <ShlObj.h>
|
||||
#include <winternl.h>
|
||||
|
||||
#if __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4005)
|
||||
#include <ntstatus.h>
|
||||
|
||||
@@ -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<long>(exceptionInfo->ExceptionRecord->ExceptionCode) == EXCEPTION_ACCESS_VIOLATION) {
|
||||
if (this->verifyPageFault(reinterpret_cast<void *>(exceptionInfo->ExceptionRecord->ExceptionInformation[1]))) {
|
||||
// this is our fault that we serviced, continue app execution
|
||||
return EXCEPTION_CONTINUE_EXECUTION;
|
||||
|
||||
@@ -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 <windows.h>
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace NEO {
|
||||
|
||||
@@ -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<int>(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<int>(sizeInBytes - totalSent), 0);
|
||||
if (bytesSent == 0 || bytesSent == INVALID_SOCKET) {
|
||||
if (bytesSent == 0 || bytesSent == static_cast<int>(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<int>(sizeInBytes - totalRecv), 0);
|
||||
if (bytesRecv == 0 || bytesRecv == INVALID_SOCKET) {
|
||||
if (bytesRecv == 0 || bytesRecv == static_cast<int>(INVALID_SOCKET)) {
|
||||
logErrorInfo("Connection Closed.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ class Timer::TimerImpl {
|
||||
};
|
||||
|
||||
LARGE_INTEGER Timer::TimerImpl::mFrequency = {
|
||||
{{0}},
|
||||
{},
|
||||
};
|
||||
|
||||
Timer::Timer() {
|
||||
|
||||
@@ -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 <dlfcn.h>
|
||||
#include <execinfo.h>
|
||||
#elif defined(_WIN32)
|
||||
#include <windows.h>
|
||||
#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 <DbgHelp.h>
|
||||
|
||||
#if __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
#pragma warning(pop) // Restores the warning state.
|
||||
#pragma comment(lib, "Dbghelp.lib")
|
||||
#endif
|
||||
|
||||
@@ -23,9 +23,18 @@
|
||||
#include <dlfcn.h>
|
||||
#include <execinfo.h>
|
||||
#elif defined(_WIN32)
|
||||
#include <windows.h>
|
||||
#include "shared/source/os_interface/windows/windows_wrapper.h"
|
||||
|
||||
#if __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wpragma-pack"
|
||||
#endif
|
||||
|
||||
#include <DbgHelp.h>
|
||||
|
||||
#if __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace MemoryManagement {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 <windows.h>
|
||||
|
||||
#include <io.h>
|
||||
#include <signal.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) {
|
||||
|
||||
@@ -505,7 +505,8 @@ TEST_F(CompilerCacheWindowsTest, givenCreateUniqueTempFileAndWriteDataWhenCreate
|
||||
|
||||
const char *binary = "12345";
|
||||
SysCalls::writeFileNumberOfBytesWritten = static_cast<DWORD>(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<DWORD>(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;
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ struct MockWddmCsr : public WddmCommandStreamReceiver<GfxFamily> {
|
||||
directSubmissionControllerStarted = true;
|
||||
}
|
||||
int flushCalledCount = 0;
|
||||
std::unique_ptr<CommandBuffer> recordedCommandBuffer = nullptr;
|
||||
std::unique_ptr<CommandBuffer> recordedCommandBuffer;
|
||||
|
||||
bool callParentInitDirectSubmission = true;
|
||||
bool initBlitterDirectSubmission = false;
|
||||
|
||||
@@ -21,13 +21,13 @@ using namespace NEO;
|
||||
|
||||
class OsLibraryBackup : public Windows::OsLibrary {
|
||||
using Type = decltype(Windows::OsLibrary::loadLibraryExA);
|
||||
using BackupType = typename VariableBackup<Type>;
|
||||
using BackupType = VariableBackup<Type>;
|
||||
|
||||
using ModuleNameType = decltype(Windows::OsLibrary::getModuleFileNameA);
|
||||
using ModuleNameBackupType = typename VariableBackup<ModuleNameType>;
|
||||
using ModuleNameBackupType = VariableBackup<ModuleNameType>;
|
||||
|
||||
using SystemDirectoryType = decltype(Windows::OsLibrary::getSystemDirectoryA);
|
||||
using SystemDirectoryBackupType = typename VariableBackup<SystemDirectoryType>;
|
||||
using SystemDirectoryBackupType = VariableBackup<SystemDirectoryType>;
|
||||
|
||||
struct Backup {
|
||||
std::unique_ptr<BackupType> bkp1 = nullptr;
|
||||
@@ -119,4 +119,4 @@ TEST(OSLibraryWinTest, GivenNoLastErrorOnWindowsThenErrorStringisEmpty) {
|
||||
lib->getLastErrorString(&errorValue);
|
||||
EXPECT_TRUE(errorValue.empty());
|
||||
lib->getLastErrorString(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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> osInterface(new OSInterface());
|
||||
osInterface->setDriverModel(std::unique_ptr<DriverModel>(wddm));
|
||||
auto osTime = OSTime::create(osInterface.get());
|
||||
|
||||
@@ -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
|
||||
} // namespace NEO
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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 <windows.h>
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
|
||||
@@ -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 <windows.h>
|
||||
# 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
|
||||
|
||||
Reference in New Issue
Block a user