Cleanup includes 27

Cleaned up files:
opencl/source/command_queue/command_queue.h
shared/source/built_ins/registry/built_ins_registry.h
shared/source/kernel/kernel_descriptor.h

Related-To: NEO-5548
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
This commit is contained in:
Warchulski, Jaroslaw 2023-01-11 15:32:55 +00:00 committed by Compute-Runtime-Automation
parent d19e8ffbf9
commit 3d59dce80c
41 changed files with 212 additions and 132 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -8,6 +8,7 @@
#include "level_zero/core/source/builtin/builtin_functions_lib_impl.h"
#include "shared/source/built_ins/built_ins.h"
#include "shared/source/debug_settings/debug_settings_manager.h"
#include "level_zero/core/source/device/device.h"
#include "level_zero/core/source/kernel/kernel.h"

View File

@ -13,6 +13,7 @@
#include "shared/source/command_stream/wait_status.h"
#include "shared/source/debug_settings/debug_settings_manager.h"
#include "shared/source/debugger/debugger_l0.h"
#include "shared/source/helpers/aligned_memory.h"
#include "shared/source/memory_manager/allocation_properties.h"
#include "shared/source/memory_manager/memory_manager.h"
#include "shared/source/os_interface/os_context.h"

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -9,6 +9,7 @@
#include "shared/source/command_container/command_encoder.h"
#include "shared/source/device/device.h"
#include "shared/source/helpers/aligned_memory.h"
#include "shared/source/helpers/cache_policy.h"
#include "shared/source/kernel/implicit_args.h"
#include "shared/source/memory_manager/unified_memory_manager.h"

View File

@ -23,6 +23,7 @@
#include "shared/source/execution_environment/execution_environment.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/helpers/addressing_mode_helper.h"
#include "shared/source/helpers/aligned_memory.h"
#include "shared/source/helpers/api_specific_config.h"
#include "shared/source/helpers/compiler_hw_info_config.h"
#include "shared/source/helpers/constants.h"

View File

@ -1,10 +1,11 @@
/*
* Copyright (C) 2022 Intel Corporation
* Copyright (C) 2022-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/helpers/aligned_memory.h"
#include "shared/test/common/cmd_parse/gen_cmd_parse.h"
#include "shared/test/common/helpers/unit_test_helper.h"
#include "shared/test/common/mocks/mock_graphics_allocation.h"

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -9,6 +9,7 @@
#include "shared/source/built_ins/built_ins.h"
#include "shared/source/compiler_interface/compiler_options.h"
#include "shared/source/helpers/aligned_memory.h"
#include "shared/source/helpers/basic_math.h"
#include "shared/source/helpers/debug_helpers.h"

View File

@ -1,10 +1,11 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/built_ins/built_ins.h"
#include "shared/source/built_ins/registry/built_ins_registry.h"
#include "opencl/source/built_ins/built_in_ops_vme.h"

View File

@ -18,6 +18,8 @@
#include "opencl/source/execution_environment/cl_execution_environment.h"
#include "opencl/source/program/program.h"
#include <sstream>
namespace NEO {
static const char *blockMotionEstimateIntelSrc = {

View File

@ -12,6 +12,7 @@
#include "shared/source/helpers/basic_math.h"
#include "shared/source/helpers/hw_helper.h"
#include "shared/source/helpers/local_work_size.h"
#include "shared/source/utilities/logger.h"
#include "opencl/source/context/context.h"
#include "opencl/source/helpers/dispatch_info.h"

View File

@ -30,12 +30,14 @@
#include "opencl/source/built_ins/builtins_dispatch_builder.h"
#include "opencl/source/cl_device/cl_device.h"
#include "opencl/source/command_queue/csr_selection_args.h"
#include "opencl/source/context/context.h"
#include "opencl/source/event/event_builder.h"
#include "opencl/source/event/user_event.h"
#include "opencl/source/gtpin/gtpin_notify.h"
#include "opencl/source/helpers/cl_hw_helper.h"
#include "opencl/source/helpers/convert_color.h"
#include "opencl/source/helpers/dispatch_info.h"
#include "opencl/source/helpers/hardware_commands_helper.h"
#include "opencl/source/helpers/mipmap.h"
#include "opencl/source/helpers/queue_helpers.h"
@ -895,6 +897,13 @@ void CommandQueue::releaseIndirectHeap(IndirectHeap::Type heapType) {
getGpgpuCommandStreamReceiver().releaseIndirectHeap(heapType);
}
void CommandQueue::releaseVirtualEvent() {
if (this->virtualEvent != nullptr) {
this->virtualEvent->decRefInternal();
this->virtualEvent = nullptr;
}
}
void CommandQueue::obtainNewTimestampPacketNodes(size_t numberOfNodes, TimestampPacketContainer &previousNodes, bool clearAllDependencies, CommandStreamReceiver &csr) {
TagAllocatorBase *allocator = csr.getTimestampPacketAllocator();

View File

@ -6,21 +6,29 @@
*/
#pragma once
#include "shared/source/helpers/completion_stamp.h"
#include "shared/source/helpers/engine_control.h"
#include "shared/source/helpers/timestamp_packet.h"
#include "shared/source/sku_info/sku_info_base.h"
#include "shared/source/unified_memory/unified_memory.h"
#include "shared/source/utilities/range.h"
#include "opencl/source/api/cl_types.h"
#include "opencl/source/command_queue/copy_engine_state.h"
#include "opencl/source/command_queue/csr_selection_args.h"
#include "opencl/source/event/event.h"
#include "opencl/source/helpers/base_object.h"
#include "opencl/source/helpers/dispatch_info.h"
#include "opencl/source/helpers/enqueue_properties.h"
#include "opencl/source/helpers/properties_helper.h"
#include "opencl/source/helpers/task_information.h"
#include <cstdint>
enum InternalMemoryType : uint32_t;
namespace NEO {
struct BuiltinOpParams;
struct CsrSelectionArgs;
class PrintfHandler;
enum class WaitStatus;
class BarrierCommand;
class Buffer;
class LinearStream;
@ -246,23 +254,18 @@ class CommandQueue : public BaseObject<_cl_command_queue> {
}
MOCKABLE_VIRTUAL LinearStream &getCS(size_t minRequiredSize);
IndirectHeap &getIndirectHeap(IndirectHeap::Type heapType,
IndirectHeap &getIndirectHeap(IndirectHeapType heapType,
size_t minRequiredSize);
void allocateHeapMemory(IndirectHeap::Type heapType,
void allocateHeapMemory(IndirectHeapType heapType,
size_t minRequiredSize, IndirectHeap *&indirectHeap);
static bool isAssignEngineRoundRobinEnabled();
static bool isTimestampWaitEnabled();
MOCKABLE_VIRTUAL void releaseIndirectHeap(IndirectHeap::Type heapType);
MOCKABLE_VIRTUAL void releaseIndirectHeap(IndirectHeapType heapType);
void releaseVirtualEvent() {
if (this->virtualEvent != nullptr) {
this->virtualEvent->decRefInternal();
this->virtualEvent = nullptr;
}
}
void releaseVirtualEvent();
cl_command_queue_properties getCommandQueueProperties() const {
return commandQueueProperties;

View File

@ -14,6 +14,7 @@
#include "opencl/source/cl_device/cl_device.h"
#include "opencl/source/command_queue/command_queue.h"
#include "opencl/source/command_queue/csr_selection_args.h"
#include "opencl/source/command_queue/gpgpu_walker.h"
#include "opencl/source/helpers/dispatch_info.h"
#include "opencl/source/helpers/queue_helpers.h"

View File

@ -8,6 +8,7 @@
#include "opencl/source/command_queue/resource_barrier.h"
#include "shared/source/compiler_interface/compiler_cache.h"
#include "shared/source/device/device.h"
#include "shared/source/memory_manager/unified_memory_manager.h"
#include "shared/source/utilities/range.h"

View File

@ -9,6 +9,7 @@
#include "shared/source/built_ins/built_ins.h"
#include "shared/source/command_stream/command_stream_receiver.h"
#include "shared/source/compiler_interface/compiler_cache.h"
#include "shared/source/compiler_interface/compiler_interface.h"
#include "shared/source/debug_settings/debug_settings_manager.h"
#include "shared/source/device/sub_device.h"

View File

@ -9,11 +9,14 @@
#include "shared/source/command_stream/command_stream_receiver.h"
#include "shared/source/compiler_interface/compiler_cache.h"
#include "shared/source/device/device.h"
#include "shared/source/helpers/timestamp_packet.h"
#include "shared/source/memory_manager/memory_manager.h"
#include "shared/source/os_interface/os_context.h"
#include "opencl/source/cl_device/cl_device.h"
#include "opencl/source/command_queue/command_queue.h"
#include "opencl/source/event/event.h"
#include "opencl/source/helpers/mipmap.h"
#include "opencl/source/mem_obj/image.h"
#include "opencl/source/mem_obj/mem_obj.h"

View File

@ -43,6 +43,7 @@
#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/event/event.h"
#include "opencl/source/gtpin/gtpin_notify.h"
#include "opencl/source/helpers/cl_hw_helper.h"
#include "opencl/source/helpers/cl_validators.h"

View File

@ -15,6 +15,7 @@
#include "shared/source/kernel/kernel_execution_type.h"
#include "shared/source/program/kernel_info.h"
#include "shared/source/unified_memory/unified_memory.h"
#include "shared/source/utilities/logger.h"
#include "opencl/extensions/public/cl_ext_private.h"
#include "opencl/source/cl_device/cl_device.h"

View File

@ -8,6 +8,7 @@
#include "opencl/source/mem_obj/buffer.h"
#include "shared/source/command_container/implicit_scaling.h"
#include "shared/source/device/device.h"
#include "shared/source/execution_environment/execution_environment.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/gmm_helper/gmm_helper.h"
@ -16,6 +17,7 @@
#include "shared/source/memory_manager/memory_operations_handler.h"
#include "shared/source/os_interface/os_interface.h"
#include "opencl/source/cl_device/cl_device.h"
#include "opencl/source/command_queue/command_queue.h"
#include "opencl/source/context/context.h"
#include "opencl/source/helpers/cl_memory_properties_helpers.h"

View File

@ -11,6 +11,7 @@
#include "shared/test/common/mocks/mock_device.h"
#include "shared/test/common/test_macros/test.h"
#include "opencl/source/event/event.h"
#include "opencl/source/helpers/hardware_commands_helper.h"
#include "opencl/source/mem_obj/buffer.h"
#include "opencl/test/unit_test/aub_tests/fixtures/hello_world_fixture.h"

View File

@ -10,6 +10,7 @@
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "opencl/source/event/user_event.h"
#include "opencl/source/helpers/dispatch_info.h"
#include "opencl/test/unit_test/context/driver_diagnostics_tests.h"
#include "opencl/test/unit_test/fixtures/buffer_fixture.h"
#include "opencl/test/unit_test/test_macros/test_checks_ocl.h"

View File

@ -12,6 +12,7 @@
#include "shared/test/common/mocks/mock_gmm.h"
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
#include "opencl/source/helpers/dispatch_info.h"
#include "opencl/source/mem_obj/mem_obj_helper.h"
#include <tuple>

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2021 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -7,6 +7,7 @@
#pragma once
#include "shared/source/helpers/aligned_memory.h"
#include "shared/source/memory_manager/memory_manager.h"
#include "shared/source/program/kernel_info.h"
#include "shared/test/common/mocks/mock_kernel_info.h"

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -12,6 +12,7 @@
#include "opencl/source/event/user_event.h"
#include "opencl/source/helpers/cl_preemption_helper.h"
#include "opencl/source/helpers/dispatch_info.h"
#include "opencl/test/unit_test/fixtures/cl_preemption_fixture.h"
using namespace NEO;

View File

@ -5,6 +5,7 @@
*
*/
#include "shared/source/device/device.h"
#include "shared/source/direct_submission/direct_submission_controller.h"
#include "shared/source/execution_environment/execution_environment.h"
#include "shared/source/helpers/aligned_memory.h"
@ -42,6 +43,7 @@ extern const char *dxcoreDllName;
}
namespace NEO {
class OsLibrary;
void __attribute__((destructor)) platformsDestructor();
extern const DeviceDescriptor deviceDescriptorTable[];
} // namespace NEO

View File

@ -6,6 +6,7 @@
*/
#include "shared/source/built_ins/built_ins.h"
#include "shared/source/compiler_interface/compiler_cache.h"
#include "shared/source/compiler_interface/compiler_interface.h"
#include "shared/source/helpers/aligned_memory.h"
#include "shared/source/image/image_surface_state.h"

View File

@ -11,6 +11,7 @@
#include "shared/source/device/device.h"
#include "shared/source/execution_environment/execution_environment.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/helpers/aligned_memory.h"
#include "shared/source/helpers/ptr_math.h"
#include "shared/source/program/kernel_info.h"
#include "shared/test/common/mocks/mock_compiler_interface.h"

View File

@ -13,6 +13,7 @@
#include "shared/test/common/mocks/mock_execution_environment.h"
#include "shared/test/common/mocks/mock_os_context.h"
#include "opencl/source/event/event.h"
#include "opencl/test/unit_test/fixtures/device_instrumentation_fixture.h"
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
#include "opencl/test/unit_test/os_interface/mock_performance_counters.h"

View File

@ -1,11 +1,12 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "opencl/source/helpers/cl_preemption_helper.h"
#include "opencl/source/helpers/dispatch_info.h"
#include "opencl/test/unit_test/fixtures/cl_preemption_fixture.h"
#include "gtest/gtest.h"

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2022 Intel Corporation
* Copyright (C) 2021-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -13,6 +13,7 @@
#include "opencl/source/command_queue/gpgpu_walker.h"
#include "opencl/source/command_queue/hardware_interface.h"
#include "opencl/source/event/event.h"
#include "opencl/test/unit_test/command_queue/hardware_interface_helper.h"
#include "opencl/test/unit_test/fixtures/ult_command_stream_receiver_fixture.h"
#include "opencl/test/unit_test/mocks/mock_command_queue.h"

View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2020-2022 Intel Corporation
# Copyright (C) 2020-2023 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
@ -11,6 +11,7 @@ set(NEO_CORE_SRCS_BUILT_INS
${CMAKE_CURRENT_SOURCE_DIR}/built_ins.cpp
${CMAKE_CURRENT_SOURCE_DIR}/built_ins.h
${CMAKE_CURRENT_SOURCE_DIR}/built_in_ops_base.h
${CMAKE_CURRENT_SOURCE_DIR}/registry/built_ins_registry.cpp
${CMAKE_CURRENT_SOURCE_DIR}/sip.cpp
${CMAKE_CURRENT_SOURCE_DIR}/sip.h
${CMAKE_CURRENT_SOURCE_DIR}/sip_kernel_type.h

View File

@ -0,0 +1,19 @@
/*
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/built_ins/registry/built_ins_registry.h"
#include "shared/source/built_ins/built_ins.h"
namespace NEO {
RegisterEmbeddedResource::RegisterEmbeddedResource(const char *name, const char *resource, size_t resourceLength) {
auto &storageRegistry = EmbeddedStorageRegistry::getInstance();
storageRegistry.store(name, createBuiltinResource(resource, resourceLength));
}
} // namespace NEO

View File

@ -7,17 +7,12 @@
#pragma once
#include "shared/source/built_ins/built_ins.h"
#include <string>
namespace NEO {
struct RegisterEmbeddedResource {
RegisterEmbeddedResource(const char *name, const char *resource, size_t resourceLength) {
auto &storageRegistry = EmbeddedStorageRegistry::getInstance();
storageRegistry.store(name, createBuiltinResource(resource, resourceLength));
}
RegisterEmbeddedResource(const char *name, const char *resource, size_t resourceLength);
RegisterEmbeddedResource(const char *name, std::string &&resource)
: RegisterEmbeddedResource(name, resource.data(), resource.size() + 1) {

View File

@ -1,10 +1,11 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/built_ins/built_ins.h"
#include "shared/source/built_ins/registry/built_ins_registry.h"
#include <string>

View File

@ -16,6 +16,7 @@
#include "shared/source/device_binary_format/elf/zebin_elf.h"
#include "shared/source/device_binary_format/elf/zeinfo_enum_lookup.h"
#include "shared/source/device_binary_format/yaml/yaml_parser.h"
#include "shared/source/helpers/aligned_memory.h"
#include "shared/source/helpers/basic_math.h"
#include "shared/source/helpers/ptr_math.h"
#include "shared/source/kernel/kernel_arg_descriptor_extended_vme.h"

View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2019-2022 Intel Corporation
# Copyright (C) 2019-2023 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
@ -14,6 +14,7 @@ set(NEO_CORE_KERNEL
${CMAKE_CURRENT_SOURCE_DIR}/kernel_arg_descriptor.h
${CMAKE_CURRENT_SOURCE_DIR}/kernel_arg_descriptor_extended_vme.h
${CMAKE_CURRENT_SOURCE_DIR}/kernel_arg_metadata.h
${CMAKE_CURRENT_SOURCE_DIR}/kernel_descriptor.cpp
${CMAKE_CURRENT_SOURCE_DIR}/kernel_descriptor.h
${CMAKE_CURRENT_SOURCE_DIR}/kernel_descriptor_from_patchtokens.cpp
${CMAKE_CURRENT_SOURCE_DIR}/kernel_descriptor_from_patchtokens.h

View File

@ -1,10 +1,11 @@
/*
* Copyright (C) 2022 Intel Corporation
* Copyright (C) 2022-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/helpers/aligned_memory.h"
#include "shared/source/helpers/basic_math.h"
#include "shared/source/helpers/hw_info.h"
#include "shared/source/helpers/hw_walk_order.h"

View File

@ -0,0 +1,111 @@
/*
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/kernel/kernel_descriptor.h"
#include "shared/source/helpers/aligned_memory.h"
namespace NEO {
void KernelDescriptor::updateCrossThreadDataSize() {
uint32_t crossThreadDataSize = 0;
for (uint32_t i = 0; i < 3; i++) {
if (isValidOffset(payloadMappings.dispatchTraits.globalWorkOffset[i])) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, payloadMappings.dispatchTraits.globalWorkOffset[i] + sizeof(uint32_t));
}
if (isValidOffset(payloadMappings.dispatchTraits.globalWorkSize[i])) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, payloadMappings.dispatchTraits.globalWorkSize[i] + sizeof(uint32_t));
}
if (isValidOffset(payloadMappings.dispatchTraits.localWorkSize[i])) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, payloadMappings.dispatchTraits.localWorkSize[i] + sizeof(uint32_t));
}
if (isValidOffset(payloadMappings.dispatchTraits.localWorkSize2[i])) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, payloadMappings.dispatchTraits.localWorkSize2[i] + sizeof(uint32_t));
}
if (isValidOffset(payloadMappings.dispatchTraits.enqueuedLocalWorkSize[i])) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, payloadMappings.dispatchTraits.enqueuedLocalWorkSize[i] + sizeof(uint32_t));
}
if (isValidOffset(payloadMappings.dispatchTraits.numWorkGroups[i])) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, payloadMappings.dispatchTraits.numWorkGroups[i] + sizeof(uint32_t));
}
}
if (isValidOffset(payloadMappings.dispatchTraits.workDim)) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, payloadMappings.dispatchTraits.workDim + sizeof(uint32_t));
}
StackVec<ArgDescPointer *, 8> implicitArgsVec({&payloadMappings.implicitArgs.printfSurfaceAddress,
&payloadMappings.implicitArgs.globalVariablesSurfaceAddress,
&payloadMappings.implicitArgs.globalConstantsSurfaceAddress,
&payloadMappings.implicitArgs.privateMemoryAddress,
&payloadMappings.implicitArgs.deviceSideEnqueueEventPoolSurfaceAddress,
&payloadMappings.implicitArgs.deviceSideEnqueueDefaultQueueSurfaceAddress,
&payloadMappings.implicitArgs.systemThreadSurfaceAddress,
&payloadMappings.implicitArgs.syncBufferAddress});
for (size_t i = 0; i < implicitArgsVec.size(); i++) {
if (isValidOffset(implicitArgsVec[i]->bindless)) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, implicitArgsVec[i]->bindless + sizeof(uint32_t));
}
if (isValidOffset(implicitArgsVec[i]->stateless)) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, implicitArgsVec[i]->stateless + implicitArgsVec[i]->pointerSize);
}
}
StackVec<CrossThreadDataOffset *, 7> implicitArgsVec2({&payloadMappings.implicitArgs.privateMemorySize,
&payloadMappings.implicitArgs.maxWorkGroupSize,
&payloadMappings.implicitArgs.simdSize,
&payloadMappings.implicitArgs.deviceSideEnqueueParentEvent,
&payloadMappings.implicitArgs.preferredWkgMultiple,
&payloadMappings.implicitArgs.localMemoryStatelessWindowSize,
&payloadMappings.implicitArgs.localMemoryStatelessWindowStartAddres});
for (size_t i = 0; i < implicitArgsVec2.size(); i++) {
if (isValidOffset(*implicitArgsVec2[i])) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, *implicitArgsVec2[i] + sizeof(uint32_t));
}
}
for (size_t i = 0; i < payloadMappings.explicitArgs.size(); i++) {
switch (payloadMappings.explicitArgs[i].type) {
case ArgDescriptor::ArgType::ArgTImage: {
auto &argImage = payloadMappings.explicitArgs[i].as<ArgDescImage>(false);
if (isValidOffset(argImage.bindless)) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, argImage.bindless + sizeof(uint32_t));
}
} break;
case ArgDescriptor::ArgType::ArgTPointer: {
auto &argPtr = payloadMappings.explicitArgs[i].as<ArgDescPointer>(false);
if (isValidOffset(argPtr.bindless)) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, argPtr.bindless + sizeof(uint32_t));
}
if (isValidOffset(argPtr.stateless)) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, argPtr.stateless + argPtr.pointerSize);
}
} break;
case ArgDescriptor::ArgType::ArgTSampler: {
auto &argSampler = payloadMappings.explicitArgs[i].as<ArgDescSampler>(false);
UNRECOVERABLE_IF(isValidOffset(argSampler.bindless));
} break;
case ArgDescriptor::ArgType::ArgTValue: {
auto &argVal = payloadMappings.explicitArgs[i].as<ArgDescValue>(false);
for (size_t i = 0; i < argVal.elements.size(); i++) {
UNRECOVERABLE_IF(!isValidOffset(argVal.elements[i].offset));
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, argVal.elements[i].offset + argVal.elements[i].size);
}
} break;
default:
break;
}
}
this->kernelAttributes.crossThreadDataSize = std::max<uint16_t>(this->kernelAttributes.crossThreadDataSize, static_cast<uint16_t>(alignUp(crossThreadDataSize, 32)));
}
} // namespace NEO

View File

@ -9,8 +9,6 @@
#include "shared/source/command_stream/thread_arbitration_policy.h"
#include "shared/source/device_binary_format/device_binary_formats.h"
#include "shared/source/helpers/aligned_memory.h"
#include "shared/source/helpers/debug_helpers.h"
#include "shared/source/kernel/debug_data.h"
#include "shared/source/kernel/grf_config.h"
#include "shared/source/kernel/kernel_arg_descriptor.h"
@ -40,102 +38,7 @@ struct KernelDescriptor {
KernelDescriptor() = default;
virtual ~KernelDescriptor() = default;
void updateCrossThreadDataSize() {
uint32_t crossThreadDataSize = 0;
for (uint32_t i = 0; i < 3; i++) {
if (isValidOffset(payloadMappings.dispatchTraits.globalWorkOffset[i])) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, payloadMappings.dispatchTraits.globalWorkOffset[i] + sizeof(uint32_t));
}
if (isValidOffset(payloadMappings.dispatchTraits.globalWorkSize[i])) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, payloadMappings.dispatchTraits.globalWorkSize[i] + sizeof(uint32_t));
}
if (isValidOffset(payloadMappings.dispatchTraits.localWorkSize[i])) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, payloadMappings.dispatchTraits.localWorkSize[i] + sizeof(uint32_t));
}
if (isValidOffset(payloadMappings.dispatchTraits.localWorkSize2[i])) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, payloadMappings.dispatchTraits.localWorkSize2[i] + sizeof(uint32_t));
}
if (isValidOffset(payloadMappings.dispatchTraits.enqueuedLocalWorkSize[i])) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, payloadMappings.dispatchTraits.enqueuedLocalWorkSize[i] + sizeof(uint32_t));
}
if (isValidOffset(payloadMappings.dispatchTraits.numWorkGroups[i])) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, payloadMappings.dispatchTraits.numWorkGroups[i] + sizeof(uint32_t));
}
}
if (isValidOffset(payloadMappings.dispatchTraits.workDim)) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, payloadMappings.dispatchTraits.workDim + sizeof(uint32_t));
}
StackVec<ArgDescPointer *, 8> implicitArgsVec({&payloadMappings.implicitArgs.printfSurfaceAddress,
&payloadMappings.implicitArgs.globalVariablesSurfaceAddress,
&payloadMappings.implicitArgs.globalConstantsSurfaceAddress,
&payloadMappings.implicitArgs.privateMemoryAddress,
&payloadMappings.implicitArgs.deviceSideEnqueueEventPoolSurfaceAddress,
&payloadMappings.implicitArgs.deviceSideEnqueueDefaultQueueSurfaceAddress,
&payloadMappings.implicitArgs.systemThreadSurfaceAddress,
&payloadMappings.implicitArgs.syncBufferAddress});
for (size_t i = 0; i < implicitArgsVec.size(); i++) {
if (isValidOffset(implicitArgsVec[i]->bindless)) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, implicitArgsVec[i]->bindless + sizeof(uint32_t));
}
if (isValidOffset(implicitArgsVec[i]->stateless)) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, implicitArgsVec[i]->stateless + implicitArgsVec[i]->pointerSize);
}
}
StackVec<CrossThreadDataOffset *, 7> implicitArgsVec2({&payloadMappings.implicitArgs.privateMemorySize,
&payloadMappings.implicitArgs.maxWorkGroupSize,
&payloadMappings.implicitArgs.simdSize,
&payloadMappings.implicitArgs.deviceSideEnqueueParentEvent,
&payloadMappings.implicitArgs.preferredWkgMultiple,
&payloadMappings.implicitArgs.localMemoryStatelessWindowSize,
&payloadMappings.implicitArgs.localMemoryStatelessWindowStartAddres});
for (size_t i = 0; i < implicitArgsVec2.size(); i++) {
if (isValidOffset(*implicitArgsVec2[i])) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, *implicitArgsVec2[i] + sizeof(uint32_t));
}
}
for (size_t i = 0; i < payloadMappings.explicitArgs.size(); i++) {
switch (payloadMappings.explicitArgs[i].type) {
case ArgDescriptor::ArgType::ArgTImage: {
auto &argImage = payloadMappings.explicitArgs[i].as<ArgDescImage>(false);
if (isValidOffset(argImage.bindless)) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, argImage.bindless + sizeof(uint32_t));
}
} break;
case ArgDescriptor::ArgType::ArgTPointer: {
auto &argPtr = payloadMappings.explicitArgs[i].as<ArgDescPointer>(false);
if (isValidOffset(argPtr.bindless)) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, argPtr.bindless + sizeof(uint32_t));
}
if (isValidOffset(argPtr.stateless)) {
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, argPtr.stateless + argPtr.pointerSize);
}
} break;
case ArgDescriptor::ArgType::ArgTSampler: {
auto &argSampler = payloadMappings.explicitArgs[i].as<ArgDescSampler>(false);
UNRECOVERABLE_IF(isValidOffset(argSampler.bindless));
} break;
case ArgDescriptor::ArgType::ArgTValue: {
auto &argVal = payloadMappings.explicitArgs[i].as<ArgDescValue>(false);
for (size_t i = 0; i < argVal.elements.size(); i++) {
UNRECOVERABLE_IF(!isValidOffset(argVal.elements[i].offset));
crossThreadDataSize = std::max<uint32_t>(crossThreadDataSize, argVal.elements[i].offset + argVal.elements[i].size);
}
} break;
default:
break;
}
}
this->kernelAttributes.crossThreadDataSize = std::max<uint16_t>(this->kernelAttributes.crossThreadDataSize, static_cast<uint16_t>(alignUp(crossThreadDataSize, 32)));
}
void updateCrossThreadDataSize();
struct KernelAttributes {
uint32_t slmInlineSize = 0U;

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -7,6 +7,7 @@
#include "shared/source/kernel/kernel_descriptor_from_patchtokens.h"
#include "shared/source/debug_settings/debug_settings_manager.h"
#include "shared/source/device_binary_format/patchtokens_decoder.h"
#include "shared/source/kernel/kernel_arg_descriptor_extended_vme.h"
#include "shared/source/kernel/kernel_descriptor.h"

View File

@ -1,10 +1,11 @@
/*
* Copyright (C) 2022 Intel Corporation
* Copyright (C) 2022-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/helpers/aligned_memory.h"
#include "shared/source/helpers/hw_walk_order.h"
#include "shared/source/helpers/per_thread_data.h"
#include "shared/source/kernel/implicit_args.h"

View File

@ -1,11 +1,12 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/device_binary_format/patchtokens_decoder.h"
#include "shared/source/helpers/aligned_memory.h"
#include "shared/source/kernel/kernel_arg_descriptor_extended_vme.h"
#include "shared/source/kernel/kernel_descriptor.h"
#include "shared/source/kernel/kernel_descriptor_from_patchtokens.h"