Skip to content

Commit 0363749

Browse files
Disjoint local work size code from hw command generation
Signed-off-by: Zbigniew Zdanowicz <[email protected]>
1 parent 9175dd2 commit 0363749

File tree

9 files changed

+42
-27
lines changed

9 files changed

+42
-27
lines changed

opencl/source/command_queue/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
set(RUNTIME_SRCS_COMMAND_QUEUE
88
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
9+
${CMAKE_CURRENT_SOURCE_DIR}/cl_local_work_size.cpp
10+
${CMAKE_CURRENT_SOURCE_DIR}/cl_local_work_size.h
911
${CMAKE_CURRENT_SOURCE_DIR}/command_queue.cpp
1012
${CMAKE_CURRENT_SOURCE_DIR}/command_queue.h
1113
${CMAKE_CURRENT_SOURCE_DIR}/command_queue_hw.h
@@ -42,7 +44,6 @@ set(RUNTIME_SRCS_COMMAND_QUEUE
4244
${CMAKE_CURRENT_SOURCE_DIR}/hardware_interface.h
4345
${CMAKE_CURRENT_SOURCE_DIR}/hardware_interface_base.inl
4446
${CMAKE_CURRENT_SOURCE_DIR}/hardware_interface_bdw_and_later.inl
45-
${CMAKE_CURRENT_SOURCE_DIR}/local_work_size.cpp
4647
${CMAKE_CURRENT_SOURCE_DIR}/resource_barrier.cpp
4748
${CMAKE_CURRENT_SOURCE_DIR}/resource_barrier.h
4849
)

opencl/source/command_queue/local_work_size.cpp renamed to opencl/source/command_queue/cl_local_work_size.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
/*
2-
* Copyright (C) 2018-2021 Intel Corporation
2+
* Copyright (C) 2021 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
66
*/
77

8-
#include "shared/source/helpers/local_work_size.h"
8+
#include "opencl/source/command_queue/cl_local_work_size.h"
99

1010
#include "shared/source/device/device.h"
1111
#include "shared/source/helpers/array_count.h"
1212
#include "shared/source/helpers/basic_math.h"
1313
#include "shared/source/helpers/debug_helpers.h"
1414
#include "shared/source/helpers/hw_helper.h"
15-
#include "shared/source/program/kernel_info.h"
15+
#include "shared/source/helpers/local_work_size.h"
1616

17-
#include "opencl/source/cl_device/cl_device.h"
18-
#include "opencl/source/command_queue/gpgpu_walker.h"
1917
#include "opencl/source/context/context.h"
2018
#include "opencl/source/helpers/dispatch_info.h"
21-
#include "opencl/source/kernel/kernel.h"
2219

2320
#include <cmath>
2421
#include <cstdint>
@@ -72,7 +69,7 @@ Vec3<size_t> generateWorkgroupsNumber(const DispatchInfo &dispatchInfo) {
7269
return generateWorkgroupsNumber(dispatchInfo.getGWS(), dispatchInfo.getLocalWorkgroupSize());
7370
}
7471

75-
void provideLocalWorkGroupSizeHints(Context *context, DispatchInfo dispatchInfo) {
72+
void provideLocalWorkGroupSizeHints(Context *context, const DispatchInfo &dispatchInfo) {
7673
if (context != nullptr && context->isProvidingPerformanceHints() && dispatchInfo.getDim() <= 3) {
7774
size_t preferredWorkGroupSize[3];
7875

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright (C) 2021 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*
6+
*/
7+
8+
#pragma once
9+
#include "shared/source/helpers/vec.h"
10+
#include "shared/source/program/kernel_info.h"
11+
12+
namespace NEO {
13+
class Context;
14+
class DispatchInfo;
15+
16+
Vec3<size_t> computeWorkgroupSize(
17+
const DispatchInfo &dispatchInfo);
18+
19+
Vec3<size_t> generateWorkgroupSize(
20+
const DispatchInfo &dispatchInfo);
21+
22+
Vec3<size_t> generateWorkgroupsNumber(
23+
const DispatchInfo &dispatchInfo);
24+
25+
void provideLocalWorkGroupSizeHints(Context *context, const DispatchInfo &dispatchInfo);
26+
27+
WorkSizeInfo createWorkSizeInfoFromDispatchInfo(const DispatchInfo &dispatchInfo);
28+
29+
} // namespace NEO

opencl/source/command_queue/gpgpu_walker.h

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
#include "shared/source/command_stream/preemption.h"
1313
#include "shared/source/helpers/register_offsets.h"
1414
#include "shared/source/helpers/timestamp_packet.h"
15-
#include "shared/source/helpers/vec.h"
1615
#include "shared/source/indirect_heap/indirect_heap.h"
1716
#include "shared/source/utilities/hw_timestamps.h"
1817
#include "shared/source/utilities/perf_counter.h"
1918
#include "shared/source/utilities/tag_allocator.h"
2019

20+
#include "opencl/source/command_queue/cl_local_work_size.h"
2121
#include "opencl/source/command_queue/command_queue.h"
2222
#include "opencl/source/context/context.h"
2323
#include "opencl/source/device_queue/device_queue_hw.h"
@@ -35,19 +35,6 @@ using WALKER_TYPE = typename GfxFamily::WALKER_TYPE;
3535
template <typename GfxFamily>
3636
using MI_STORE_REG_MEM = typename GfxFamily::MI_STORE_REGISTER_MEM_CMD;
3737

38-
Vec3<size_t> computeWorkgroupSize(
39-
const DispatchInfo &dispatchInfo);
40-
41-
Vec3<size_t> generateWorkgroupSize(
42-
const DispatchInfo &dispatchInfo);
43-
44-
Vec3<size_t> generateWorkgroupsNumber(
45-
const DispatchInfo &dispatchInfo);
46-
47-
void provideLocalWorkGroupSizeHints(Context *context, DispatchInfo dispatchInfo);
48-
49-
WorkSizeInfo createWorkSizeInfoFromDispatchInfo(const DispatchInfo &dispatchInfo);
50-
5138
template <typename GfxFamily>
5239
class GpgpuWalkerHelper {
5340
public:

opencl/source/helpers/dispatch_info_builder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#pragma once
99
#include "shared/source/helpers/local_work_size.h"
1010

11-
#include "opencl/source/command_queue/gpgpu_walker.h"
11+
#include "opencl/source/command_queue/cl_local_work_size.h"
1212
#include "opencl/source/helpers/dispatch_info.h"
1313
#include "opencl/source/kernel/kernel.h"
1414

opencl/source/kernel/kernel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
#include "opencl/source/accelerators/intel_motion_estimation.h"
3333
#include "opencl/source/built_ins/builtins_dispatch_builder.h"
3434
#include "opencl/source/cl_device/cl_device.h"
35+
#include "opencl/source/command_queue/cl_local_work_size.h"
3536
#include "opencl/source/command_queue/command_queue.h"
36-
#include "opencl/source/command_queue/gpgpu_walker.h"
3737
#include "opencl/source/context/context.h"
3838
#include "opencl/source/device_queue/device_queue.h"
3939
#include "opencl/source/execution_model/device_enqueue.h"

opencl/test/unit_test/api/cl_get_kernel_suggested_local_work_size_intel_tests.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
*
66
*/
77

8+
#include "opencl/source/command_queue/cl_local_work_size.h"
89
#include "opencl/source/command_queue/command_queue.h"
9-
#include "opencl/source/command_queue/gpgpu_walker.h"
1010
#include "opencl/test/unit_test/mocks/mock_kernel.h"
1111

1212
#include "cl_api_tests.h"

opencl/test/unit_test/command_queue/local_work_size_tests.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
#include "shared/test/common/helpers/debug_manager_state_restore.h"
1010
#include "shared/test/common/mocks/mock_device.h"
1111

12-
#include "opencl/source/command_queue/gpgpu_walker.h"
12+
#include "opencl/source/command_queue/cl_local_work_size.h"
13+
#include "opencl/source/helpers/dispatch_info.h"
1314
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
1415
#include "opencl/test/unit_test/mocks/mock_kernel.h"
1516
#include "test.h"

opencl/test/unit_test/context/driver_diagnostics_tests.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include "shared/test/common/mocks/mock_device.h"
1212
#include "shared/test/common/test_macros/test_checks_shared.h"
1313

14-
#include "opencl/source/command_queue/gpgpu_walker.h"
14+
#include "opencl/source/command_queue/cl_local_work_size.h"
1515
#include "opencl/source/context/context.h"
1616
#include "opencl/source/kernel/kernel.h"
1717
#include "opencl/source/mem_obj/buffer.h"

0 commit comments

Comments
 (0)