Disjoint local work size code from hw command generation

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2021-10-05 13:01:17 +00:00
committed by Compute-Runtime-Automation
parent 9175dd251c
commit 0363749948
9 changed files with 42 additions and 27 deletions

View File

@@ -6,6 +6,8 @@
set(RUNTIME_SRCS_COMMAND_QUEUE
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/cl_local_work_size.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cl_local_work_size.h
${CMAKE_CURRENT_SOURCE_DIR}/command_queue.cpp
${CMAKE_CURRENT_SOURCE_DIR}/command_queue.h
${CMAKE_CURRENT_SOURCE_DIR}/command_queue_hw.h
@@ -42,7 +44,6 @@ set(RUNTIME_SRCS_COMMAND_QUEUE
${CMAKE_CURRENT_SOURCE_DIR}/hardware_interface.h
${CMAKE_CURRENT_SOURCE_DIR}/hardware_interface_base.inl
${CMAKE_CURRENT_SOURCE_DIR}/hardware_interface_bdw_and_later.inl
${CMAKE_CURRENT_SOURCE_DIR}/local_work_size.cpp
${CMAKE_CURRENT_SOURCE_DIR}/resource_barrier.cpp
${CMAKE_CURRENT_SOURCE_DIR}/resource_barrier.h
)

View File

@@ -1,24 +1,21 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
* Copyright (C) 2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/helpers/local_work_size.h"
#include "opencl/source/command_queue/cl_local_work_size.h"
#include "shared/source/device/device.h"
#include "shared/source/helpers/array_count.h"
#include "shared/source/helpers/basic_math.h"
#include "shared/source/helpers/debug_helpers.h"
#include "shared/source/helpers/hw_helper.h"
#include "shared/source/program/kernel_info.h"
#include "shared/source/helpers/local_work_size.h"
#include "opencl/source/cl_device/cl_device.h"
#include "opencl/source/command_queue/gpgpu_walker.h"
#include "opencl/source/context/context.h"
#include "opencl/source/helpers/dispatch_info.h"
#include "opencl/source/kernel/kernel.h"
#include <cmath>
#include <cstdint>
@@ -72,7 +69,7 @@ Vec3<size_t> generateWorkgroupsNumber(const DispatchInfo &dispatchInfo) {
return generateWorkgroupsNumber(dispatchInfo.getGWS(), dispatchInfo.getLocalWorkgroupSize());
}
void provideLocalWorkGroupSizeHints(Context *context, DispatchInfo dispatchInfo) {
void provideLocalWorkGroupSizeHints(Context *context, const DispatchInfo &dispatchInfo) {
if (context != nullptr && context->isProvidingPerformanceHints() && dispatchInfo.getDim() <= 3) {
size_t preferredWorkGroupSize[3];

View File

@@ -0,0 +1,29 @@
/*
* Copyright (C) 2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/helpers/vec.h"
#include "shared/source/program/kernel_info.h"
namespace NEO {
class Context;
class DispatchInfo;
Vec3<size_t> computeWorkgroupSize(
const DispatchInfo &dispatchInfo);
Vec3<size_t> generateWorkgroupSize(
const DispatchInfo &dispatchInfo);
Vec3<size_t> generateWorkgroupsNumber(
const DispatchInfo &dispatchInfo);
void provideLocalWorkGroupSizeHints(Context *context, const DispatchInfo &dispatchInfo);
WorkSizeInfo createWorkSizeInfoFromDispatchInfo(const DispatchInfo &dispatchInfo);
} // namespace NEO

View File

@@ -12,12 +12,12 @@
#include "shared/source/command_stream/preemption.h"
#include "shared/source/helpers/register_offsets.h"
#include "shared/source/helpers/timestamp_packet.h"
#include "shared/source/helpers/vec.h"
#include "shared/source/indirect_heap/indirect_heap.h"
#include "shared/source/utilities/hw_timestamps.h"
#include "shared/source/utilities/perf_counter.h"
#include "shared/source/utilities/tag_allocator.h"
#include "opencl/source/command_queue/cl_local_work_size.h"
#include "opencl/source/command_queue/command_queue.h"
#include "opencl/source/context/context.h"
#include "opencl/source/device_queue/device_queue_hw.h"
@@ -35,19 +35,6 @@ using WALKER_TYPE = typename GfxFamily::WALKER_TYPE;
template <typename GfxFamily>
using MI_STORE_REG_MEM = typename GfxFamily::MI_STORE_REGISTER_MEM_CMD;
Vec3<size_t> computeWorkgroupSize(
const DispatchInfo &dispatchInfo);
Vec3<size_t> generateWorkgroupSize(
const DispatchInfo &dispatchInfo);
Vec3<size_t> generateWorkgroupsNumber(
const DispatchInfo &dispatchInfo);
void provideLocalWorkGroupSizeHints(Context *context, DispatchInfo dispatchInfo);
WorkSizeInfo createWorkSizeInfoFromDispatchInfo(const DispatchInfo &dispatchInfo);
template <typename GfxFamily>
class GpgpuWalkerHelper {
public:

View File

@@ -8,7 +8,7 @@
#pragma once
#include "shared/source/helpers/local_work_size.h"
#include "opencl/source/command_queue/gpgpu_walker.h"
#include "opencl/source/command_queue/cl_local_work_size.h"
#include "opencl/source/helpers/dispatch_info.h"
#include "opencl/source/kernel/kernel.h"

View File

@@ -32,8 +32,8 @@
#include "opencl/source/accelerators/intel_motion_estimation.h"
#include "opencl/source/built_ins/builtins_dispatch_builder.h"
#include "opencl/source/cl_device/cl_device.h"
#include "opencl/source/command_queue/cl_local_work_size.h"
#include "opencl/source/command_queue/command_queue.h"
#include "opencl/source/command_queue/gpgpu_walker.h"
#include "opencl/source/context/context.h"
#include "opencl/source/device_queue/device_queue.h"
#include "opencl/source/execution_model/device_enqueue.h"