Skip to content

Commit c3b8727

Browse files
Remove opencl includes from HwHelper
Resolves: NEO-3964 Change-Id: Ie891ba6a205a89b41ca2cce0fa386dc4c93a0aaa Signed-off-by: Filip Hazubski <[email protected]>
1 parent 39a3e95 commit c3b8727

File tree

18 files changed

+44
-23
lines changed

18 files changed

+44
-23
lines changed

level_zero/core/source/device/device.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#include <level_zero/ze_api.h>
2020
#include <level_zero/zet_api.h>
2121

22+
#include "CL/cl.h"
23+
2224
struct _ze_device_handle_t {};
2325
namespace NEO {
2426
class Device;

level_zero/core/source/image/image_format_desc_helper.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
#include "shared/source/utilities/compiler_support.h"
1111

12+
#include "third_party/opencl_headers/CL/cl_ext_intel.h"
13+
1214
namespace L0 {
1315

1416
cl_channel_type getClChannelDataType(const ze_image_format_t &imgDescription) {

level_zero/core/source/kernel/kernel_imp.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "shared/source/utilities/arrayref.h"
1919

2020
#include "opencl/source/command_queue/gpgpu_walker.h"
21+
#include "opencl/source/mem_obj/buffer.h"
2122
#include "opencl/source/program/kernel_info.h"
2223

2324
#include "level_zero/core/source/device/device.h"

level_zero/core/source/windows/driver_teardown.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#include "level_zero/core/source/driver/driver_handle_imp.h"
99

10+
#include <Windows.h>
11+
1012
using namespace L0;
1113

1214
BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
@@ -17,4 +19,4 @@ BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
1719
}
1820
}
1921
return TRUE;
20-
}
22+
}

opencl/source/cl_device/cl_device_caps.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*
66
*/
77

8+
#include "shared/source/debug_settings/debug_settings_manager.h"
89
#include "shared/source/device/device.h"
910
#include "shared/source/device/device_info.h"
1011
#include "shared/source/helpers/basic_math.h"

opencl/source/command_queue/enqueue_common.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "opencl/source/event/user_event.h"
2828
#include "opencl/source/gtpin/gtpin_notify.h"
2929
#include "opencl/source/helpers/cl_blit_properties.h"
30+
#include "opencl/source/helpers/cl_hw_helper.h"
3031
#include "opencl/source/helpers/dispatch_info_builder.h"
3132
#include "opencl/source/helpers/enqueue_properties.h"
3233
#include "opencl/source/helpers/hardware_commands_helper.h"
@@ -94,7 +95,7 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface *(&surfaces)[surfaceCount
9495
}
9596
}
9697

97-
if (HwHelperHw<GfxFamily>::isBlitAuxTranslationRequired(device->getHardwareInfo(), multiDispatchInfo)) {
98+
if (ClHwHelperHw<GfxFamily>::isBlitAuxTranslationRequired(device->getHardwareInfo(), multiDispatchInfo)) {
9899
setupBlitAuxTranslation(multiDispatchInfo);
99100
}
100101

@@ -182,7 +183,7 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface **surfacesForResidency,
182183
CsrDependencies csrDeps;
183184
BlitPropertiesContainer blitPropertiesContainer;
184185

185-
bool enqueueWithBlitAuxTranslation = HwHelperHw<GfxFamily>::isBlitAuxTranslationRequired(device->getHardwareInfo(), multiDispatchInfo);
186+
bool enqueueWithBlitAuxTranslation = ClHwHelperHw<GfxFamily>::isBlitAuxTranslationRequired(device->getHardwareInfo(), multiDispatchInfo);
186187

187188
if (getGpgpuCommandStreamReceiver().peekTimestampPacketWriteEnabled()) {
188189
eventsRequest.fillCsrDependencies(csrDeps, getGpgpuCommandStreamReceiver(), CsrDependencies::DependenciesType::OnCsr);
@@ -210,7 +211,7 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface **surfacesForResidency,
210211
blockedCommandsData, surfacesForResidency, numSurfaceForResidency);
211212
auto commandStreamStart = commandStream.getUsed();
212213

213-
if (HwHelperHw<GfxFamily>::isBlitAuxTranslationRequired(device->getHardwareInfo(), multiDispatchInfo)) {
214+
if (ClHwHelperHw<GfxFamily>::isBlitAuxTranslationRequired(device->getHardwareInfo(), multiDispatchInfo)) {
214215
processDispatchForBlitAuxTranslation(multiDispatchInfo, blitPropertiesContainer, timestampPacketDependencies,
215216
eventsRequest, blockQueue);
216217
}

opencl/source/helpers/cl_hw_helper.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
namespace NEO {
1313

14+
struct HardwareInfo;
1415
struct KernelInfo;
16+
struct MultiDispatchInfo;
1517

1618
class ClHwHelper {
1719
public:
@@ -33,6 +35,7 @@ class ClHwHelperHw : public ClHwHelper {
3335
return clHwHelper;
3436
}
3537

38+
static bool isBlitAuxTranslationRequired(const HardwareInfo &hwInfo, const MultiDispatchInfo &multiDispatchInfo);
3639
bool requiresAuxResolves(const KernelInfo &kernelInfo) const override;
3740

3841
protected:

opencl/source/helpers/cl_hw_helper_base.inl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,22 @@
55
*
66
*/
77

8+
#include "shared/source/helpers/hw_helper.h"
9+
810
#include "opencl/source/helpers/cl_hw_helper.h"
11+
#include "opencl/source/helpers/dispatch_info.h"
912
#include "opencl/source/program/kernel_info.h"
1013

1114
namespace NEO {
1215

16+
template <typename Family>
17+
bool ClHwHelperHw<Family>::isBlitAuxTranslationRequired(const HardwareInfo &hwInfo, const MultiDispatchInfo &multiDispatchInfo) {
18+
return (HwHelperHw<Family>::getAuxTranslationMode() == AuxTranslationMode::Blit) &&
19+
hwInfo.capabilityTable.blitterOperationsSupported &&
20+
multiDispatchInfo.getMemObjsForAuxTranslation() &&
21+
(multiDispatchInfo.getMemObjsForAuxTranslation()->size() > 0);
22+
}
23+
1324
template <typename GfxFamily>
1425
inline bool ClHwHelperHw<GfxFamily>::requiresAuxResolves(const KernelInfo &kernelInfo) const {
1526
return hasStatelessAccessToBuffer(kernelInfo);

opencl/test/unit_test/command_queue/blit_enqueue_tests.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "shared/test/unit_test/utilities/base_object_utils.h"
1717

1818
#include "opencl/source/event/user_event.h"
19+
#include "opencl/source/mem_obj/buffer.h"
1920
#include "opencl/test/unit_test/helpers/unit_test_helper.h"
2021
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
2122
#include "opencl/test/unit_test/mocks/mock_command_queue.h"

opencl/test/unit_test/command_queue/enqueue_command_without_kernel_tests.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "opencl/source/event/event_builder.h"
1313
#include "opencl/source/event/user_event.h"
1414
#include "opencl/source/helpers/enqueue_properties.h"
15+
#include "opencl/source/mem_obj/buffer.h"
1516
#include "opencl/test/unit_test/fixtures/dispatch_flags_fixture.h"
1617
#include "opencl/test/unit_test/fixtures/enqueue_handler_fixture.h"
1718
#include "opencl/test/unit_test/mocks/mock_command_queue.h"

0 commit comments

Comments
 (0)