Skip to content

Commit cfca721

Browse files
Remove from api_intercept api_enter
- create new api_enter file - fix dependencies - remove platform include form wddm Change-Id: I5614c3aadbf373b58dfdb34f2f3dec8977e20a3d
1 parent 8e3c589 commit cfca721

File tree

10 files changed

+36
-78
lines changed

10 files changed

+36
-78
lines changed

runtime/api/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (C) 2018-2019 Intel Corporation
2+
# Copyright (C) 2018-2020 Intel Corporation
33
#
44
# SPDX-License-Identifier: MIT
55
#
@@ -10,6 +10,7 @@ set(RUNTIME_SRCS_API
1010
${CMAKE_CURRENT_SOURCE_DIR}/additional_extensions.h
1111
${CMAKE_CURRENT_SOURCE_DIR}/api.cpp
1212
${CMAKE_CURRENT_SOURCE_DIR}/api.h
13+
${CMAKE_CURRENT_SOURCE_DIR}/api_enter.h
1314
${CMAKE_CURRENT_SOURCE_DIR}/cl_types.h
1415
${CMAKE_CURRENT_SOURCE_DIR}/dispatch.cpp
1516
${CMAKE_CURRENT_SOURCE_DIR}/dispatch.h

runtime/api/api.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
/*
2-
* Copyright (C) 2017-2019 Intel Corporation
2+
* Copyright (C) 2017-2020 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
66
*/
77

88
#include "public/cl_ext_private.h"
9+
#include "runtime/api/api_enter.h"
910
#include "runtime/api/dispatch.h"
1011

1112
#include "CL/cl.h"

runtime/api/api_enter.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright (C) 2020 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*
6+
*/
7+
8+
#include "runtime/utilities/logger.h"
9+
#include "runtime/utilities/perf_profiler.h"
10+
11+
#define API_ENTER(retValPointer) \
12+
LoggerApiEnterWrapper<NEO::FileLogger<globalDebugFunctionalityLevel>::enabled()> ApiWrapperForSingleCall(__FUNCTION__, retValPointer)
13+
14+
#if KMD_PROFILING == 1
15+
#undef API_ENTER
16+
17+
#define API_ENTER(x) \
18+
PerfProfilerApiWrapper globalPerfProfilersWrapperInstanceForSingleApiFunction(__FUNCTION__)
19+
#endif

runtime/os_interface/linux/device_factory_linux.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/*
2-
* Copyright (C) 2017-2019 Intel Corporation
2+
* Copyright (C) 2017-2020 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
66
*/
77

8+
#include "core/debug_settings/debug_settings_manager.h"
89
#include "core/execution_environment/root_device_environment.h"
910
#include "core/helpers/hw_info.h"
1011
#include "runtime/device/device.h"

runtime/os_interface/linux/drm_neo.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
/*
2-
* Copyright (C) 2017-2019 Intel Corporation
2+
* Copyright (C) 2017-2020 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
66
*/
77

88
#include "drm_neo.h"
99

10+
#include "core/debug_settings/debug_settings_manager.h"
11+
#include "core/helpers/debug_helpers.h"
1012
#include "core/helpers/hw_info.h"
1113
#include "core/memory_manager/memory_constants.h"
1214
#include "core/os_interface/linux/os_inc.h"

runtime/os_interface/windows/gdi_interface.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
/*
2-
* Copyright (C) 2017-2019 Intel Corporation
2+
* Copyright (C) 2017-2020 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
66
*/
77

88
#include "gdi_interface.h"
99

10+
#include "core/debug_settings/debug_settings_manager.h"
11+
1012
namespace NEO {
1113

1214
inline const std::string getGdiName() {

runtime/os_interface/windows/thk_wrapper.h

Lines changed: 1 addition & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2017-2019 Intel Corporation
2+
* Copyright (C) 2017-2020 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -11,65 +11,6 @@
1111
#include <d3dkmthk.h>
1212

1313
namespace NEO {
14-
// IDs for easy system times identification
15-
enum SystemCallsIds {
16-
SYSTIMER_ID_OPENADAPTERFROMHDC = 1,
17-
SYSTIMER_ID_OPENADAPTERFROMLUID = 2,
18-
SYSTIMER_ID_CLOSEADAPTER = 3,
19-
SYSTIMER_ID_QUERYADAPTERINFO = 4,
20-
SYSTIMER_ID_ESCAPE = 5,
21-
SYSTIMER_ID_CREATEDEVICE = 6,
22-
SYSTIMER_ID_DESTROYDEVICE = 7,
23-
SYSTIMER_ID_CREATECONTEXT = 8,
24-
SYSTIMER_ID_DESTROYCONTEXT = 9,
25-
SYSTIMER_ID_CREATEALLOCATION = 10,
26-
SYSTIMER_ID_DESTROYALLOCATION = 11,
27-
SYSTIMER_ID_OPENRESOURCE = 12,
28-
SYSTIMER_ID_QUERYRESOURCEINFO = 13,
29-
SYSTIMER_ID_LOCK = 14,
30-
SYSTIMER_ID_UNLOCK = 15,
31-
SYSTIMER_ID_RENDER = 16,
32-
SYSTIMER_ID_CREATESYNCHRONIZATIONOBJECT = 17,
33-
SYSTIMER_ID_DESTROYSYNCHRONIZATIONOBJECT = 18,
34-
SYSTIMER_ID_SIGNALSYNCHRONIZATIONOBJECT = 19,
35-
SYSTIMER_ID_WAITFORSYNCHRONIZATIONOBJECT = 20,
36-
SYSTIMER_ID_CREATESYNCHRONIZATIONOBJECT2 = 21,
37-
SYSTIMER_ID_GETDEVICESTATE = 22,
38-
SYSTIMER_ID_MAKERESIDENT = 23,
39-
SYSTIMER_ID_EVICT = 24,
40-
SYSTIMER_ID_WAITFORSYNCHRONIZATIONOBJECTFROMCPU = 25,
41-
SYSTIMER_ID_SIGNALSYNCHRONIZATIONOBJECTFROMCPU = 26,
42-
SYSTIMER_ID_WAITFORSYNCHRONIZATIONOBJECTFROMGPU = 27,
43-
SYSTIMER_ID_SIGNALSYNCHRONIZATIONOBJECTFROMGPU = 28,
44-
SYSTIMER_ID_CREATEPAGINGQUEUE = 29,
45-
SYSTIMER_ID_D3DDDI_DESTROYPAGINGQUEUE = 30,
46-
SYSTIMER_ID_LOCK2 = 31,
47-
SYSTIMER_ID_UNLOCK2 = 32,
48-
SYSTIMER_ID_INVALIDATECACHE = 33,
49-
SYSTIMER_ID_D3DDDI_MAPGPUVIRTUALADDRESS = 34,
50-
SYSTIMER_ID_D3DDDI_RESERVEGPUVIRTUALADDRESS = 35,
51-
SYSTIMER_ID_FREEGPUVIRTUALADDRESS = 36,
52-
SYSTIMER_ID_UPDATEGPUVIRTUALADDRESS = 37,
53-
SYSTIMER_ID_CREATECONTEXTVIRTUAL = 38,
54-
SYSTIMER_ID_SUBMITCOMMAND = 39,
55-
SYSTIMER_ID_OPENSYNCOBJECTFROMNTHANDLE2 = 40,
56-
SYSTIMER_ID_OPENSYNCOBJECTNTHANDLEFROMNAME = 41,
57-
SYSTIMER_ID_DESTROYALLOCATION2 = 42,
58-
SYSTIMER_ID_REGISTERTRIMNOTIFICATION = 43,
59-
SYSTIMER_ID_UNREGISTERTRIMNOTIFICATION = 44,
60-
SYSTIMER_ID_QUERYRESOURCEINFOFROMNTHANDLE = 45,
61-
SYSTIMER_ID_OPENRESOURCEFROMNTHANDLE = 46,
62-
SYSTIMER_ID_CREATEHWQUEUE = 47,
63-
SYSTIMER_ID_DESTROYHWQUEUE = 48,
64-
SYSTIMER_ID_SUBMITCOMMANDTOHWQUEUE = 49,
65-
66-
SYSTIMER_ID_SLEEP_0 = 100,
67-
SYSTIMER_ID_WAIT_FOR_KMD = 200,
68-
SYSTIMER_ID_CMD_COMPLETE = 300,
69-
70-
SYSTIMER_ID_OGL = 400,
71-
};
72-
7314
template <typename Param>
7415
class ThkWrapper {
7516
typedef NTSTATUS(APIENTRY *Func)(Param);

runtime/os_interface/windows/wddm/wddm.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "runtime/os_interface/windows/wddm/wddm_interface.h"
2929
#include "runtime/os_interface/windows/wddm_allocation.h"
3030
#include "runtime/os_interface/windows/wddm_residency_allocations_container.h"
31-
#include "runtime/platform/platform.h"
3231

3332
#include "gmm_memory.h"
3433

@@ -117,7 +116,7 @@ bool Wddm::init(HardwareInfo &outHardwareInfo) {
117116
return false;
118117
}
119118

120-
platform()->peekExecutionEnvironment()->initGmm();
119+
rootDeviceEnvironment.executionEnvironment.initGmm();
121120

122121
auto preemptionMode = PreemptionHelper::getDefaultPreemptionMode(outHardwareInfo);
123122

runtime/utilities/api_intercept.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,22 @@
11
/*
2-
* Copyright (C) 2017-2019 Intel Corporation
2+
* Copyright (C) 2017-2020 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
66
*/
77

88
#pragma once
9-
#include "runtime/utilities/logger.h"
10-
#include "runtime/utilities/perf_profiler.h"
11-
12-
#define API_ENTER(retValPointer) \
13-
LoggerApiEnterWrapper<NEO::FileLogger<globalDebugFunctionalityLevel>::enabled()> ApiWrapperForSingleCall(__FUNCTION__, retValPointer)
149
#define SYSTEM_ENTER()
1510
#define SYSTEM_LEAVE(id)
1611
#define WAIT_ENTER()
1712
#define WAIT_LEAVE()
1813

1914
#if KMD_PROFILING == 1
20-
#undef API_ENTER
2115
#undef SYSTEM_ENTER
2216
#undef SYSTEM_LEAVE
2317
#undef WAIT_ENTER
2418
#undef WAIT_LEAVE
2519

26-
#define API_ENTER(x) \
27-
PerfProfilerApiWrapper globalPerfProfilersWrapperInstanceForSingleApiFunction(__FUNCTION__)
28-
2920
#define SYSTEM_ENTER() \
3021
PerfProfiler::create(); \
3122
gPerfProfiler->systemEnter();

unit_tests/os_interface/linux/device_command_stream_fixture.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2017-2019 Intel Corporation
2+
* Copyright (C) 2017-2020 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -8,6 +8,7 @@
88
#pragma once
99
#include "core/helpers/aligned_memory.h"
1010
#include "core/helpers/hw_helper.h"
11+
#include "core/helpers/options.h"
1112
#include "runtime/os_interface/linux/drm_memory_manager.h"
1213
#include "runtime/os_interface/linux/drm_neo.h"
1314
#include "unit_tests/helpers/gtest_helpers.h"

0 commit comments

Comments
 (0)