Move kernel info to shared directory

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz 2021-09-29 19:10:53 +00:00 committed by Compute-Runtime-Automation
parent f0003c1da6
commit 25c71a6c13
53 changed files with 101 additions and 193 deletions

View File

@ -19,11 +19,11 @@
#include "shared/source/memory_manager/memory_manager.h"
#include "shared/source/memory_manager/memory_operations_handler.h"
#include "shared/source/memory_manager/unified_memory_manager.h"
#include "shared/source/program/kernel_info.h"
#include "shared/source/utilities/arrayref.h"
#include "opencl/source/command_queue/gpgpu_walker.h"
#include "opencl/source/mem_obj/buffer.h"
#include "opencl/source/program/kernel_info.h"
#include "level_zero/core/source/debugger/debugger_l0.h"
#include "level_zero/core/source/device/device.h"

View File

@ -17,11 +17,10 @@
#include "shared/source/helpers/string.h"
#include "shared/source/memory_manager/memory_manager.h"
#include "shared/source/memory_manager/unified_memory_manager.h"
#include "shared/source/program/kernel_info.h"
#include "shared/source/program/program_initialization.h"
#include "shared/source/source_level_debugger/source_level_debugger.h"
#include "opencl/source/program/kernel_info.h"
#include "level_zero/core/source/device/device.h"
#include "level_zero/core/source/kernel/kernel.h"
#include "level_zero/core/source/module/module_build_log.h"

View File

@ -9,12 +9,12 @@
#include "shared/source/helpers/file_io.h"
#include "shared/source/memory_manager/allocation_properties.h"
#include "shared/source/program/kernel_info.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/helpers/test_files.h"
#include "shared/test/common/mocks/mock_compilers.h"
#include "shared/test/common/mocks/mock_graphics_allocation.h"
#include "opencl/source/program/kernel_info.h"
#include "opencl/test/unit_test/mocks/mock_memory_manager.h"
#include "level_zero/core/source/module/module.h"

View File

@ -9,6 +9,7 @@
#include "shared/source/gmm_helper/gmm_interface.h"
#include "shared/source/helpers/hw_info.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/source/program/kernel_info.h"
#include "shared/source/utilities/debug_settings_reader.h"
#include "shared/source/utilities/logger.h"
#include "shared/test/common/helpers/custom_event_listener.h"
@ -21,8 +22,6 @@
#include "shared/test/common/mocks/mock_sip.h"
#include "shared/test/unit_test/base_ult_config_listener.h"
#include "opencl/source/program/kernel_info.h"
#include "level_zero/core/source/cmdlist/cmdlist.h"
#include "level_zero/core/source/compiler_interface/l0_reg_path.h"

View File

@ -7,11 +7,11 @@
#include "shared/source/device_binary_format/patchtokens_decoder.h"
#include "shared/source/kernel/kernel_descriptor_from_patchtokens.h"
#include "shared/source/program/kernel_info.h"
#include "shared/test/common/helpers/unit_test_helper.h"
#include "shared/test/common/mocks/mock_compilers.h"
#include "shared/test/common/mocks/mock_elf.h"
#include "opencl/source/program/kernel_info.h"
#include "opencl/source/program/kernel_info_from_patchtokens.h"
#include "test.h"

View File

@ -8,6 +8,7 @@
#include "shared/source/device_binary_format/patchtokens_decoder.h"
#include "shared/source/helpers/local_memory_access_modes.h"
#include "shared/source/kernel/kernel_descriptor.h"
#include "shared/source/program/kernel_info.h"
#include "shared/source/utilities/stackvec.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/helpers/engine_descriptor_helper.h"
@ -15,7 +16,6 @@
#include "shared/test/common/mocks/mock_graphics_allocation.h"
#include "shared/test/unit_test/device_binary_format/patchtokens_tests.h"
#include "opencl/source/program/kernel_info.h"
#include "opencl/source/program/kernel_info_from_patchtokens.h"
#include "test.h"

View File

@ -8,13 +8,13 @@
#include "shared/source/gmm_helper/gmm.h"
#include "shared/source/gmm_helper/gmm_helper.h"
#include "shared/source/kernel/implicit_args.h"
#include "shared/source/program/kernel_info.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/mocks/mock_elf.h"
#include "shared/test/common/mocks/mock_graphics_allocation.h"
#include "shared/test/unit_test/compiler_interface/linker_mock.h"
#include "shared/test/unit_test/device_binary_format/zebin_tests.h"
#include "opencl/source/program/kernel_info.h"
#include "test.h"
#include "level_zero/core/source/context/context.h"

View File

@ -14,6 +14,7 @@
#include "shared/source/helpers/timestamp_packet.h"
#include "shared/source/helpers/vec.h"
#include "shared/source/indirect_heap/indirect_heap.h"
#include "shared/source/program/kernel_info.h"
#include "shared/source/utilities/hw_timestamps.h"
#include "shared/source/utilities/perf_counter.h"
#include "shared/source/utilities/tag_allocator.h"
@ -25,7 +26,6 @@
#include "opencl/source/helpers/hardware_commands_helper.h"
#include "opencl/source/helpers/task_information.h"
#include "opencl/source/kernel/kernel.h"
#include "opencl/source/program/kernel_info.h"
namespace NEO {
@ -43,7 +43,7 @@ void computeWorkgroupSize1D(
size_t simdSize);
void computeWorkgroupSizeND(
WorkSizeInfo wsInfo,
WorkSizeInfo &wsInfo,
size_t workGroupSize[3],
const size_t workItems[3],
const uint32_t workDim);
@ -94,6 +94,8 @@ inline cl_uint computeDimensions(const size_t workItems[3]) {
: 1;
}
WorkSizeInfo createWorkSizeInfoFromDispatchInfo(const DispatchInfo &dispatchInfo);
template <typename GfxFamily>
class GpgpuWalkerHelper {
public:

View File

@ -12,6 +12,7 @@
#include "shared/source/helpers/hw_helper.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"
@ -129,7 +130,7 @@ void computePowerOfTwoLWS(const size_t workItems[3], WorkSizeInfo &workGroupInfo
}
}
void choosePreferredWorkGroupSizeWithRatio(uint32_t xyzFactors[3][1024], uint32_t xyzFactorsLen[3], size_t workGroupSize[3], const size_t workItems[3], WorkSizeInfo wsInfo) {
void choosePreferredWorkGroupSizeWithRatio(uint32_t xyzFactors[3][1024], uint32_t xyzFactorsLen[3], size_t workGroupSize[3], const size_t workItems[3], WorkSizeInfo &wsInfo) {
float ratioDiff = 0;
float localRatio = float(0xffffffff);
ulong localWkgs = 0xffffffff;
@ -172,7 +173,7 @@ void choosePreferredWorkGroupSizeWithRatio(uint32_t xyzFactors[3][1024], uint32_
}
}
}
void choosePreferredWorkGroupSizeWithOutRatio(uint32_t xyzFactors[3][1024], uint32_t xyzFactorsLen[3], size_t workGroupSize[3], const size_t workItems[3], WorkSizeInfo wsInfo, uint32_t workdim) {
void choosePreferredWorkGroupSizeWithOutRatio(uint32_t xyzFactors[3][1024], uint32_t xyzFactorsLen[3], size_t workGroupSize[3], const size_t workItems[3], WorkSizeInfo &wsInfo, uint32_t workdim) {
uint64_t localEuThrdsDispatched = 0xffffffffffffffff;
uint64_t workGroups;
for (uint32_t ZFactorsIdx = 0; ZFactorsIdx < xyzFactorsLen[2]; ++ZFactorsIdx) {
@ -331,7 +332,7 @@ void computeWorkgroupSizeSquared(uint32_t maxWorkGroupSize, size_t workGroupSize
}
}
void computeWorkgroupSizeND(WorkSizeInfo wsInfo, size_t workGroupSize[3], const size_t workItems[3], const uint32_t workDim) {
void computeWorkgroupSizeND(WorkSizeInfo &wsInfo, size_t workGroupSize[3], const size_t workItems[3], const uint32_t workDim) {
for (int i = 0; i < 3; i++)
workGroupSize[i] = 1;
@ -422,7 +423,7 @@ Vec3<size_t> computeWorkgroupSize(const DispatchInfo &dispatchInfo) {
if (kernel->requiresLimitedWorkgroupSize() && hwHelper.isSpecialWorkgroupSizeRequired(hwInfo, isSimulation)) {
setSpecialWorkgroupSize(workGroupSize);
} else if (DebugManager.flags.EnableComputeWorkSizeND.get()) {
WorkSizeInfo wsInfo(dispatchInfo);
WorkSizeInfo wsInfo = createWorkSizeInfoFromDispatchInfo(dispatchInfo);
if (wsInfo.slmTotalSize == 0 && !wsInfo.hasBarriers && !wsInfo.imgUsed && hwHelper.preferSmallWorkgroupSizeForKernel(kernel->getKernelInfo().heapInfo.KernelUnpaddedSize, hwInfo) &&
((dispatchInfo.getDim() == 1) && (dispatchInfo.getGWS().x % wsInfo.simdSize * 2 == 0))) {
wsInfo.maxWorkGroupSize = wsInfo.simdSize * 2;
@ -498,4 +499,25 @@ void provideLocalWorkGroupSizeHints(Context *context, DispatchInfo dispatchInfo)
}
}
}
WorkSizeInfo createWorkSizeInfoFromDispatchInfo(const DispatchInfo &dispatchInfo) {
auto &device = dispatchInfo.getClDevice();
const auto &kernelInfo = dispatchInfo.getKernel()->getKernelInfo();
auto numThreadsPerSubSlice = static_cast<uint32_t>(device.getSharedDeviceInfo().maxNumEUsPerSubSlice) *
device.getSharedDeviceInfo().numThreadsPerEU;
WorkSizeInfo wsInfo(dispatchInfo.getKernel()->getMaxKernelWorkGroupSize(),
kernelInfo.kernelDescriptor.kernelAttributes.usesBarriers(),
static_cast<uint32_t>(kernelInfo.getMaxSimdSize()),
static_cast<uint32_t>(dispatchInfo.getKernel()->getSlmTotalSize()),
&device.getHardwareInfo(),
numThreadsPerSubSlice,
static_cast<uint32_t>(device.getSharedDeviceInfo().localMemSize),
false,
false);
wsInfo.setIfUseImg(kernelInfo);
wsInfo.setMinWorkGroupSize(&device.getHardwareInfo());
return wsInfo;
}
} // namespace NEO

View File

@ -6,10 +6,10 @@
*/
#include "shared/source/helpers/hw_helper.h"
#include "shared/source/program/kernel_info.h"
#include "opencl/source/helpers/cl_hw_helper.h"
#include "opencl/source/helpers/dispatch_info.h"
#include "opencl/source/program/kernel_info.h"
namespace NEO {

View File

@ -8,9 +8,9 @@
#include "opencl/source/kernel/image_transformer.h"
#include "shared/source/helpers/ptr_math.h"
#include "shared/source/program/kernel_info.h"
#include "opencl/source/mem_obj/image.h"
#include "opencl/source/program/kernel_info.h"
namespace NEO {
void ImageTransformer::registerImage3d(uint32_t argIndex) {

View File

@ -25,6 +25,7 @@
#include "shared/source/memory_manager/memory_manager.h"
#include "shared/source/memory_manager/unified_memory_manager.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/source/program/kernel_info.h"
#include "opencl/source/accelerators/intel_accelerator.h"
#include "opencl/source/accelerators/intel_motion_estimation.h"
@ -51,7 +52,6 @@
#include "opencl/source/memory_manager/mem_obj_surface.h"
#include "opencl/source/platform/platform.h"
#include "opencl/source/program/block_kernel_manager.h"
#include "opencl/source/program/kernel_info.h"
#include "opencl/source/sampler/sampler.h"
#include "patch_list.h"

View File

@ -16,6 +16,7 @@
#include "shared/source/helpers/timestamp_packet.h"
#include "shared/source/kernel/implicit_args.h"
#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/stackvec.h"
@ -26,7 +27,6 @@
#include "opencl/source/helpers/base_object.h"
#include "opencl/source/helpers/properties_helper.h"
#include "opencl/source/kernel/kernel_objects_for_aux_translation.h"
#include "opencl/source/program/kernel_info.h"
#include "opencl/source/program/program.h"
#include <vector>

View File

@ -15,8 +15,6 @@ set(RUNTIME_SRCS_PROGRAM
${CMAKE_CURRENT_SOURCE_DIR}/create.inl
${CMAKE_CURRENT_SOURCE_DIR}/get_info.cpp
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}internal_options.cpp
${CMAKE_CURRENT_SOURCE_DIR}/kernel_info.cpp
${CMAKE_CURRENT_SOURCE_DIR}/kernel_info.h
${CMAKE_CURRENT_SOURCE_DIR}/kernel_info_from_patchtokens.cpp
${CMAKE_CURRENT_SOURCE_DIR}/kernel_info_from_patchtokens.h
${CMAKE_CURRENT_SOURCE_DIR}/link.cpp

View File

@ -9,8 +9,7 @@
#include "shared/source/command_stream/command_stream_receiver.h"
#include "shared/source/helpers/debug_helpers.h"
#include "opencl/source/program/kernel_info.h"
#include "shared/source/program/kernel_info.h"
namespace NEO {

View File

@ -10,6 +10,7 @@
#include "shared/source/device_binary_format/device_binary_formats.h"
#include "shared/source/execution_environment/execution_environment.h"
#include "shared/source/helpers/compiler_options_parser.h"
#include "shared/source/program/kernel_info.h"
#include "shared/source/source_level_debugger/source_level_debugger.h"
#include "shared/source/utilities/logger.h"
#include "shared/source/utilities/time_measure_wrapper.h"
@ -18,7 +19,6 @@
#include "opencl/source/gtpin/gtpin_notify.h"
#include "opencl/source/helpers/validators.h"
#include "opencl/source/platform/platform.h"
#include "opencl/source/program/kernel_info.h"
#include "opencl/source/program/program.h"
#include "compiler_options.h"

View File

@ -8,13 +8,13 @@
#include "shared/source/helpers/get_info.h"
#include "shared/source/device/device.h"
#include "shared/source/program/kernel_info.h"
#include "opencl/source/cl_device/cl_device.h"
#include "opencl/source/context/context.h"
#include "opencl/source/helpers/base_object.h"
#include "opencl/source/helpers/get_info_status_mapper.h"
#include "opencl/source/helpers/validators.h"
#include "opencl/source/program/kernel_info.h"
#include "program.h"

View File

@ -9,8 +9,7 @@
#include "shared/source/device_binary_format/patchtokens_decoder.h"
#include "shared/source/kernel/kernel_descriptor_from_patchtokens.h"
#include "opencl/source/program/kernel_info.h"
#include "shared/source/program/kernel_info.h"
#include <cstring>

View File

@ -11,6 +11,7 @@
#include "shared/source/device_binary_format/elf/elf_encoder.h"
#include "shared/source/device_binary_format/elf/ocl_elf.h"
#include "shared/source/execution_environment/execution_environment.h"
#include "shared/source/program/kernel_info.h"
#include "shared/source/source_level_debugger/source_level_debugger.h"
#include "shared/source/utilities/stackvec.h"
@ -18,7 +19,6 @@
#include "opencl/source/gtpin/gtpin_notify.h"
#include "opencl/source/helpers/validators.h"
#include "opencl/source/platform/platform.h"
#include "opencl/source/program/kernel_info.h"
#include "opencl/source/program/program.h"
#include "compiler_options.h"

View File

@ -12,13 +12,13 @@
#include "shared/source/helpers/string.h"
#include "shared/source/memory_manager/memory_manager.h"
#include "shared/source/memory_manager/unified_memory_manager.h"
#include "shared/source/program/kernel_info.h"
#include "shared/source/program/program_info.h"
#include "shared/source/program/program_initialization.h"
#include "opencl/source/cl_device/cl_device.h"
#include "opencl/source/context/context.h"
#include "opencl/source/gtpin/gtpin_notify.h"
#include "opencl/source/program/kernel_info.h"
#include "opencl/source/program/program.h"
#include "program_debug_data.h"

View File

@ -24,13 +24,13 @@
#include "shared/source/memory_manager/unified_memory_manager.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/source/os_interface/os_context.h"
#include "shared/source/program/kernel_info.h"
#include "opencl/source/cl_device/cl_device.h"
#include "opencl/source/context/context.h"
#include "opencl/source/platform/extensions.h"
#include "opencl/source/platform/platform.h"
#include "opencl/source/program/block_kernel_manager.h"
#include "opencl/source/program/kernel_info.h"
#include "compiler_options.h"

View File

@ -21,7 +21,6 @@
namespace NEO {
SamplerCreateFunc samplerFactory[IGFX_MAX_CORE] = {};
getSamplerStateSizeHwFunc getSamplerStateSizeHw[IGFX_MAX_CORE] = {};
Sampler::Sampler(Context *context, cl_bool normalizedCoordinates,
cl_addressing_mode addressingMode, cl_filter_mode filterMode,
@ -61,10 +60,6 @@ Sampler *Sampler::create(Context *context, cl_bool normalizedCoordinates,
return sampler;
}
size_t Sampler::getSamplerStateSize(const HardwareInfo &hwInfo) {
return getSamplerStateSizeHw[hwInfo.platform.eRenderCoreFamily]();
}
template <typename ParameterType>
struct SetOnce {
SetOnce(ParameterType defaultValue, ParameterType min, ParameterType max)

View File

@ -52,7 +52,6 @@ class Sampler : public BaseObject<_cl_sampler> {
virtual void setArg(void *memory, const HardwareInfo &hwInfo) = 0;
static size_t getSamplerStateSize(const HardwareInfo &hwInfo);
bool isTransformable() const;
Sampler(Context *context,
@ -124,8 +123,6 @@ struct SamplerHw : public Sampler {
lodMin,
lodMax);
}
static size_t getSamplerStateSize();
};
typedef Sampler *(*SamplerCreateFunc)(Context *context,

View File

@ -90,10 +90,4 @@ void SamplerHw<GfxFamily>::setArg(void *memory, const HardwareInfo &hwInfo) {
HwInfoConfig::get(hwInfo.platform.eProductFamily)->adjustSamplerState(samplerState, hwInfo);
}
template <typename GfxFamily>
size_t SamplerHw<GfxFamily>::getSamplerStateSize() {
using SAMPLER_STATE = typename GfxFamily::SAMPLER_STATE;
return sizeof(SAMPLER_STATE);
}
} // namespace NEO

View File

@ -13,7 +13,5 @@ template struct SamplerHw<Family>;
template <>
void populateFactoryTable<SamplerHw<Family>>() {
extern SamplerCreateFunc samplerFactory[IGFX_MAX_CORE];
extern getSamplerStateSizeHwFunc getSamplerStateSizeHw[IGFX_MAX_CORE];
samplerFactory[gfxCore] = SamplerHw<Family>::create;
getSamplerStateSizeHw[gfxCore] = SamplerHw<Family>::getSamplerStateSize;
}

View File

@ -8,11 +8,11 @@
#include "shared/source/compiler_interface/compiler_interface.h"
#include "shared/source/device/device.h"
#include "shared/source/helpers/file_io.h"
#include "shared/source/program/kernel_info.h"
#include "shared/test/common/helpers/test_files.h"
#include "shared/test/common/mocks/mock_compilers.h"
#include "opencl/source/context/context.h"
#include "opencl/source/program/kernel_info.h"
#include "opencl/source/program/program.h"
#include "opencl/test/unit_test/helpers/kernel_binary_helper.h"

View File

@ -6,10 +6,10 @@
*/
#include "shared/source/helpers/file_io.h"
#include "shared/source/program/kernel_info.h"
#include "shared/test/common/helpers/test_files.h"
#include "opencl/source/context/context.h"
#include "opencl/source/program/kernel_info.h"
#include "opencl/test/unit_test/mocks/mock_program.h"
#include "cl_api_tests.h"

View File

@ -151,7 +151,6 @@ TEST(localWorkSizeTest, given2DimWorkGroupAndSimdEqual8WhenComputeCalledThenLoca
workGroup[0] = 48;
NEO::computeWorkgroupSizeND(wsInfo, workGroupSize, workGroup, workDim);
EXPECT_EQ(workGroupSize[0], 16u);
;
EXPECT_EQ(workGroupSize[1], 16u);
EXPECT_EQ(workGroupSize[2], 1u);
@ -167,6 +166,7 @@ TEST(localWorkSizeTest, given2DimWorkGroupAndSimdEqual32WhenComputeCalledThenLoc
DebugManagerStateRestore dbgRestore;
DebugManager.flags.EnableComputeWorkSizeSquared.set(false);
WorkSizeInfo wsInfo(256, 0u, 32, 0u, defaultHwInfo.get(), 32u, 0u, false, false);
uint32_t workDim = 2;
size_t workGroup[3] = {384, 96, 1};
size_t workGroupSize[3];
@ -575,6 +575,7 @@ TEST(localWorkSizeTest, GivenUseStrictRatioWhenLwsIsBeingComputedThenWgsIsCalcul
TEST(localWorkSizeTest, GivenUseBarriersWhenLwsIsBeingComputedThenWgsIsCalculatedCorrectly) {
WorkSizeInfo wsInfo(256u, 1u, 32u, 0u, defaultHwInfo.get(), 56u, 0u, true, true);
uint32_t workDim = 2;
size_t workGroup[3] = {194, 234, 1};
size_t workGroupSize[3];
@ -585,6 +586,8 @@ TEST(localWorkSizeTest, GivenUseBarriersWhenLwsIsBeingComputedThenWgsIsCalculate
EXPECT_EQ(workGroupSize[0], 97u);
EXPECT_EQ(workGroupSize[1], 2u);
EXPECT_EQ(workGroupSize[2], 1u);
wsInfo.useRatio = false;
wsInfo.useStrictRatio = false;
wsInfo.yTiledSurfaces = false;
wsInfo.imgUsed = false;
@ -592,6 +595,8 @@ TEST(localWorkSizeTest, GivenUseBarriersWhenLwsIsBeingComputedThenWgsIsCalculate
EXPECT_EQ(workGroupSize[0], 2u);
EXPECT_EQ(workGroupSize[1], 78u);
EXPECT_EQ(workGroupSize[2], 1u);
wsInfo.useRatio = false;
wsInfo.useStrictRatio = false;
NEO::computeWorkgroupSizeND(wsInfo, workGroupSize, workGroup, workDim);
EXPECT_EQ(workGroupSize[0], 2u);
@ -601,6 +606,7 @@ TEST(localWorkSizeTest, GivenUseBarriersWhenLwsIsBeingComputedThenWgsIsCalculate
TEST(localWorkSizeTest, given2DimWorkWhenComputeSquaredCalledThenLocalGroupComputed) {
WorkSizeInfo wsInfo(256, 0u, 16, 0u, defaultHwInfo.get(), 6u, 0u, false, false);
uint32_t workDim = 2;
size_t workGroup[3] = {2048, 272, 1};
size_t workGroupSize[3];
@ -705,7 +711,7 @@ TEST(localWorkSizeTest, givenDispatchInfoWhenWorkSizeInfoIsCreatedThenItHasCorre
deviceInfo.maxNumEUsPerSubSlice = euPerSubSlice;
deviceInfo.numThreadsPerEU = threadsPerEu;
WorkSizeInfo workSizeInfo(dispatchInfo);
WorkSizeInfo workSizeInfo = createWorkSizeInfoFromDispatchInfo(dispatchInfo);
EXPECT_EQ(workSizeInfo.numThreadsPerSubSlice, threadsPerEu * euPerSubSlice);
}
@ -725,7 +731,7 @@ HWTEST_F(LocalWorkSizeTest, givenDispatchInfoWhenWorkSizeInfoIsCreatedThenTestEu
static_cast<uint32_t>(kernel.mockKernel->getKernelInfo().getMaxSimdSize()) /
maxBarriersPerHSlice;
const uint32_t fusedMinWorkGroupSize = 2 * nonFusedMinWorkGroupSize;
WorkSizeInfo workSizeInfo(dispatchInfo);
WorkSizeInfo workSizeInfo = createWorkSizeInfoFromDispatchInfo(dispatchInfo);
if (defaultHwInfo->platform.eRenderCoreFamily < IGFX_GEN12_CORE) {
EXPECT_EQ(nonFusedMinWorkGroupSize, workSizeInfo.minWorkGroupSize);
@ -753,14 +759,14 @@ HWTEST2_F(LocalWorkSizeTest, givenDispatchInfoWhenWorkSizeInfoIsCreatedThenTestE
{
const bool fusedEuDispatchDisabled = true;
DebugManager.flags.CFEFusedEUDispatch.set(fusedEuDispatchDisabled);
WorkSizeInfo workSizeInfo(dispatchInfo);
WorkSizeInfo workSizeInfo = createWorkSizeInfoFromDispatchInfo(dispatchInfo);
EXPECT_EQ(nonFusedMinWorkGroupSize, workSizeInfo.minWorkGroupSize);
}
{
const bool fusedEuDispatchDisabled = false;
DebugManager.flags.CFEFusedEUDispatch.set(fusedEuDispatchDisabled);
WorkSizeInfo workSizeInfo(dispatchInfo);
WorkSizeInfo workSizeInfo = createWorkSizeInfoFromDispatchInfo(dispatchInfo);
EXPECT_EQ(fusedMinWorkGroupSize, workSizeInfo.minWorkGroupSize);
}
}
@ -795,10 +801,10 @@ TEST(localWorkSizeTest, givenDispatchInfoWhenWorkSizeInfoIsCreatedThenHasBarrier
dispatchInfo.setKernel(kernel.mockKernel);
kernel.kernelInfo.kernelDescriptor.kernelAttributes.barrierCount = 0;
EXPECT_FALSE(WorkSizeInfo{dispatchInfo}.hasBarriers);
EXPECT_FALSE(createWorkSizeInfoFromDispatchInfo(dispatchInfo).hasBarriers);
kernel.kernelInfo.kernelDescriptor.kernelAttributes.barrierCount = 1;
EXPECT_TRUE(WorkSizeInfo{dispatchInfo}.hasBarriers);
EXPECT_TRUE(createWorkSizeInfoFromDispatchInfo(dispatchInfo).hasBarriers);
}
TEST(localWorkSizeTest, givenMaxWorkgroupSizeEqualToSimdSizeWhenLwsIsCalculatedThenItIsDownsizedToMaxWorkgroupSize) {

View File

@ -8,8 +8,8 @@
#include "opencl/test/unit_test/fixtures/kernel_arg_fixture.h"
#include "shared/source/helpers/api_specific_config.h"
#include "shared/source/program/kernel_info.h"
#include "opencl/source/program/kernel_info.h"
#include "opencl/test/unit_test/fixtures/image_fixture.h"
#include "opencl/test/unit_test/mocks/mock_context.h"
#include "opencl/test/unit_test/mocks/mock_image.h"

View File

@ -8,9 +8,9 @@
#pragma once
#include "shared/source/memory_manager/memory_manager.h"
#include "shared/source/program/kernel_info.h"
#include "opencl/source/cl_device/cl_device.h"
#include "opencl/source/program/kernel_info.h"
#include "opencl/test/unit_test/mocks/mock_context.h"
#include "opencl/test/unit_test/mocks/mock_kernel_info.h"
#include "opencl/test/unit_test/mocks/mock_program.h"

View File

@ -8,10 +8,10 @@
#include "shared/source/command_stream/linear_stream.h"
#include "shared/source/helpers/aligned_memory.h"
#include "shared/source/helpers/local_id_gen.h"
#include "shared/source/program/kernel_info.h"
#include "shared/test/common/mocks/mock_graphics_allocation.h"
#include "opencl/source/helpers/per_thread_data.h"
#include "opencl/source/program/kernel_info.h"
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
#include "opencl/test/unit_test/mocks/mock_kernel.h"
#include "test.h"

View File

@ -5,8 +5,9 @@
*
*/
#include "shared/source/program/kernel_info.h"
#include "opencl/source/kernel/image_transformer.h"
#include "opencl/source/program/kernel_info.h"
#include "opencl/test/unit_test/fixtures/image_fixture.h"
#include "opencl/test/unit_test/mocks/mock_kernel_info.h"
#include "test.h"

View File

@ -5,12 +5,12 @@
*
*/
#include "shared/source/program/kernel_info.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "opencl/source/command_queue/command_queue_hw.h"
#include "opencl/source/helpers/hardware_commands_helper.h"
#include "opencl/source/kernel/kernel.h"
#include "opencl/source/program/kernel_info.h"
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
#include "opencl/test/unit_test/mocks/mock_kernel.h"
#include "opencl/test/unit_test/mocks/mock_program.h"

View File

@ -5,7 +5,8 @@
*
*/
#include "opencl/source/program/kernel_info.h"
#include "shared/source/program/kernel_info.h"
#include "opencl/source/sampler/sampler.h"
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
#include "opencl/test/unit_test/fixtures/image_fixture.h"

View File

@ -7,8 +7,7 @@
#include "shared/source/kernel/kernel_arg_descriptor_extended_device_side_enqueue.h"
#include "shared/source/kernel/kernel_arg_descriptor_extended_vme.h"
#include "opencl/source/program/kernel_info.h"
#include "shared/source/program/kernel_info.h"
#include "patch_g7.h"
#include "patch_list.h"
@ -76,4 +75,4 @@ class MockKernelInfo : public KernelInfo {
void resizeArgsIfIndexTooBig(uint32_t index);
};
} // namespace NEO
} // namespace NEO

View File

@ -18,7 +18,6 @@
#include "opencl/source/context/context.h"
#include "opencl/source/program/create.inl"
#include "opencl/source/program/kernel_info.h"
#include "opencl/test/unit_test/helpers/ult_limits.h"
#include "opencl/test/unit_test/mocks/mock_cl_device.h"

View File

@ -9,10 +9,10 @@
#include "shared/source/device/device.h"
#include "shared/source/helpers/hash.h"
#include "shared/source/helpers/string.h"
#include "shared/source/program/kernel_info.h"
#include "opencl/source/cl_device/cl_device.h"
#include "opencl/source/kernel/multi_device_kernel.h"
#include "opencl/source/program/kernel_info.h"
#include "opencl/source/program/program.h"
#include "gmock/gmock.h"

View File

@ -6,9 +6,9 @@
*/
#include "shared/source/memory_manager/graphics_allocation.h"
#include "shared/source/program/kernel_info.h"
#include "shared/test/common/mocks/mock_graphics_allocation.h"
#include "opencl/source/program/kernel_info.h"
#include "opencl/test/unit_test/mocks/mock_block_kernel_manager.h"
#include "gtest/gtest.h"

View File

@ -6,10 +6,10 @@
*/
#include "shared/source/device_binary_format/patchtokens_decoder.h"
#include "shared/source/program/kernel_info.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/unit_test/device_binary_format/patchtokens_tests.h"
#include "opencl/source/program/kernel_info.h"
#include "opencl/source/program/kernel_info_from_patchtokens.h"
#include "gtest/gtest.h"

View File

@ -7,11 +7,11 @@
#include "shared/source/execution_environment/execution_environment.h"
#include "shared/source/memory_manager/os_agnostic_memory_manager.h"
#include "shared/source/program/kernel_info.h"
#include "shared/test/common/mocks/mock_execution_environment.h"
#include "shared/test/common/mocks/mock_graphics_allocation.h"
#include "shared/test/common/mocks/ult_device_factory.h"
#include "opencl/source/program/kernel_info.h"
#include "opencl/test/unit_test/fixtures/multi_root_device_fixture.h"
#include "gtest/gtest.h"

View File

@ -9,6 +9,7 @@
#include "shared/source/device/device.h"
#include "shared/source/helpers/file_io.h"
#include "shared/source/os_interface/os_interface.h"
#include "shared/source/program/kernel_info.h"
#include "shared/source/source_level_debugger/source_level_debugger.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/helpers/ult_hw_config.h"
@ -16,7 +17,6 @@
#include "shared/test/common/libult/source_level_debugger_library.h"
#include "opencl/source/platform/platform.h"
#include "opencl/source/program/kernel_info.h"
#include "opencl/test/unit_test/helpers/execution_environment_helper.h"
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
#include "opencl/test/unit_test/mocks/mock_platform.h"

View File

@ -6,12 +6,12 @@
*/
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/source/program/kernel_info.h"
#include "shared/test/common/cmd_parse/gen_cmd_parse.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/mocks/mock_graphics_allocation.h"
#include "opencl/source/helpers/cl_hw_helper.h"
#include "opencl/source/program/kernel_info.h"
#include "opencl/test/unit_test/helpers/hw_helper_tests.h"
#include "opencl/test/unit_test/mocks/mock_cl_hw_helper.h"

View File

@ -9,10 +9,9 @@
#include "shared/offline_compiler/source/ocloc_arg_helper.h"
#include "shared/source/device_binary_format/device_binary_formats.h"
#include "shared/source/program/kernel_info.h"
#include "shared/source/program/program_info.h"
#include "opencl/source/program/kernel_info.h"
namespace NEO {
ProgramInfo::~ProgramInfo() {
for (auto &kernelInfo : kernelInfos) {
@ -89,4 +88,4 @@ int validate(const std::vector<std::string> &args, OclocArgHelper *argHelper) {
} // namespace Ocloc
} // namespace NEO
} // namespace NEO

View File

@ -14,12 +14,11 @@
#include "shared/source/device_binary_format/elf/elf_encoder.h"
#include "shared/source/device_binary_format/elf/zebin_elf.h"
#include "shared/source/device_binary_format/yaml/yaml_parser.h"
#include "shared/source/program/kernel_info.h"
#include "shared/source/program/program_info.h"
#include "shared/source/utilities/compiler_support.h"
#include "shared/source/utilities/stackvec.h"
#include "opencl/source/program/kernel_info.h"
#include <tuple>
namespace NEO {

View File

@ -144,6 +144,7 @@ class HwHelper {
virtual bool isSipKernelAsHexadecimalArrayPreferred() const = 0;
virtual void setSipKernelData(uint32_t *&sipKernelBinary, size_t &kernelBinarySize) const = 0;
virtual void adjustPreemptionSurfaceSize(size_t &csrSize) const = 0;
virtual size_t getSamplerStateSize() const = 0;
protected:
HwHelper() = default;
@ -184,6 +185,11 @@ class HwHelperHw : public HwHelper {
return sizeof(RENDER_SURFACE_STATE);
}
size_t getSamplerStateSize() const override {
using SAMPLER_STATE = typename GfxFamily::SAMPLER_STATE;
return sizeof(SAMPLER_STATE);
}
uint32_t getBindlessSurfaceExtendedMessageDescriptorValue(uint32_t surfStateOffset) const override {
using DataPortBindlessSurfaceExtendedMessageDescriptor = typename GfxFamily::DataPortBindlessSurfaceExtendedMessageDescriptor;
DataPortBindlessSurfaceExtendedMessageDescriptor messageExtDescriptor = {};

View File

@ -7,6 +7,8 @@
set(NEO_CORE_PROGRAM
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/heap_info.h
${CMAKE_CURRENT_SOURCE_DIR}/kernel_info.cpp
${CMAKE_CURRENT_SOURCE_DIR}/kernel_info.h
${CMAKE_CURRENT_SOURCE_DIR}/print_formatter.cpp
${CMAKE_CURRENT_SOURCE_DIR}/print_formatter.h
${CMAKE_CURRENT_SOURCE_DIR}/program_info.cpp

View File

@ -5,6 +5,9 @@
*
*/
#include "shared/source/program/kernel_info.h"
#include "shared/source/device/device.h"
#include "shared/source/device_binary_format/patchtokens_decoder.h"
#include "shared/source/helpers/aligned_memory.h"
#include "shared/source/helpers/blit_commands_helper.h"
@ -14,15 +17,6 @@
#include "shared/source/helpers/string.h"
#include "shared/source/memory_manager/memory_manager.h"
#include "opencl/source/cl_device/cl_device.h"
#include "opencl/source/helpers/dispatch_info.h"
#include "opencl/source/kernel/kernel.h"
#include "opencl/source/mem_obj/buffer.h"
#include "opencl/source/mem_obj/image.h"
#include "opencl/source/sampler/sampler.h"
#include "hw_cmds.h"
#include <cstdint>
#include <cstring>
#include <map>
@ -36,88 +30,6 @@ struct KernelArgumentType {
uint64_t argTypeQualifierValue;
};
std::map<std::string, size_t> typeSizeMap = {
{"char", sizeof(cl_char)},
{"char2", sizeof(cl_char2)},
{"char3", sizeof(cl_char3)},
{"char4", sizeof(cl_char4)},
{"char8", sizeof(cl_char8)},
{"char16", sizeof(cl_char16)},
{"uchar", sizeof(cl_uchar)},
{"uchar2", sizeof(cl_uchar2)},
{"uchar3", sizeof(cl_uchar3)},
{"uchar4", sizeof(cl_uchar4)},
{"uchar8", sizeof(cl_uchar8)},
{"uchar16", sizeof(cl_uchar16)},
{"short", sizeof(cl_short)},
{"short2", sizeof(cl_short2)},
{"short3", sizeof(cl_short3)},
{"short4", sizeof(cl_short4)},
{"short8", sizeof(cl_short8)},
{"short16", sizeof(cl_short16)},
{"ushort", sizeof(cl_ushort)},
{"ushort2", sizeof(cl_ushort2)},
{"ushort3", sizeof(cl_ushort3)},
{"ushort4", sizeof(cl_ushort4)},
{"ushort8", sizeof(cl_ushort8)},
{"ushort16", sizeof(cl_ushort16)},
{"int", sizeof(cl_int)},
{"int2", sizeof(cl_int2)},
{"int3", sizeof(cl_int3)},
{"int4", sizeof(cl_int4)},
{"int8", sizeof(cl_int8)},
{"int16", sizeof(cl_int16)},
{"uint", sizeof(cl_uint)},
{"uint2", sizeof(cl_uint2)},
{"uint3", sizeof(cl_uint3)},
{"uint4", sizeof(cl_uint4)},
{"uint8", sizeof(cl_uint8)},
{"uint16", sizeof(cl_uint16)},
{"long", sizeof(cl_long)},
{"long2", sizeof(cl_long2)},
{"long3", sizeof(cl_long3)},
{"long4", sizeof(cl_long4)},
{"long8", sizeof(cl_long8)},
{"long16", sizeof(cl_long16)},
{"ulong", sizeof(cl_ulong)},
{"ulong2", sizeof(cl_ulong2)},
{"ulong3", sizeof(cl_ulong3)},
{"ulong4", sizeof(cl_ulong4)},
{"ulong8", sizeof(cl_ulong8)},
{"ulong16", sizeof(cl_ulong16)},
{"half", sizeof(cl_half)},
{"float", sizeof(cl_float)},
{"float2", sizeof(cl_float2)},
{"float3", sizeof(cl_float3)},
{"float4", sizeof(cl_float4)},
{"float8", sizeof(cl_float8)},
{"float16", sizeof(cl_float16)},
#ifdef cl_khr_fp16
{"half2", sizeof(cl_half2)},
{"half3", sizeof(cl_half3)},
{"half4", sizeof(cl_half4)},
{"half8", sizeof(cl_half8)},
{"half16", sizeof(cl_half16)},
#endif
{"double", sizeof(cl_double)},
{"double2", sizeof(cl_double2)},
{"double3", sizeof(cl_double3)},
{"double4", sizeof(cl_double4)},
{"double8", sizeof(cl_double8)},
{"double16", sizeof(cl_double16)},
};
WorkSizeInfo::WorkSizeInfo(uint32_t maxWorkGroupSize, bool hasBarriers, uint32_t simdSize, uint32_t slmTotalSize, const HardwareInfo *hwInfo, uint32_t numThreadsPerSubSlice, uint32_t localMemSize, bool imgUsed, bool yTiledSurface) {
this->maxWorkGroupSize = maxWorkGroupSize;
this->hasBarriers = hasBarriers;
@ -132,21 +44,6 @@ WorkSizeInfo::WorkSizeInfo(uint32_t maxWorkGroupSize, bool hasBarriers, uint32_t
setMinWorkGroupSize(hwInfo);
}
WorkSizeInfo::WorkSizeInfo(const DispatchInfo &dispatchInfo) {
auto &device = dispatchInfo.getClDevice();
const auto &kernelInfo = dispatchInfo.getKernel()->getKernelInfo();
this->maxWorkGroupSize = dispatchInfo.getKernel()->getMaxKernelWorkGroupSize();
this->hasBarriers = kernelInfo.kernelDescriptor.kernelAttributes.usesBarriers();
this->simdSize = static_cast<uint32_t>(kernelInfo.getMaxSimdSize());
this->slmTotalSize = static_cast<uint32_t>(dispatchInfo.getKernel()->getSlmTotalSize());
this->coreFamily = device.getHardwareInfo().platform.eRenderCoreFamily;
this->numThreadsPerSubSlice = static_cast<uint32_t>(device.getSharedDeviceInfo().maxNumEUsPerSubSlice) *
device.getSharedDeviceInfo().numThreadsPerEU;
this->localMemSize = static_cast<uint32_t>(device.getSharedDeviceInfo().localMemSize);
setIfUseImg(kernelInfo);
setMinWorkGroupSize(&device.getHardwareInfo());
}
void WorkSizeInfo::setIfUseImg(const KernelInfo &kernelInfo) {
for (const auto &arg : kernelInfo.kernelDescriptor.payloadMappings.explicitArgs) {
if (arg.is<ArgDescriptor::ArgTImage>()) {
@ -192,7 +89,7 @@ size_t KernelInfo::getSamplerStateArrayCount() const {
return kernelDescriptor.payloadMappings.samplerTable.numSamplers;
}
size_t KernelInfo::getSamplerStateArraySize(const HardwareInfo &hwInfo) const {
size_t samplerStateArraySize = getSamplerStateArrayCount() * Sampler::getSamplerStateSize(hwInfo);
size_t samplerStateArraySize = getSamplerStateArrayCount() * HwHelper::get(hwInfo.platform.eRenderCoreFamily).getSamplerStateSize();
return samplerStateArraySize;
}

View File

@ -35,8 +35,6 @@ struct KernelArgumentType;
class GraphicsAllocation;
class MemoryManager;
extern std::map<std::string, size_t> typeSizeMap;
static const float YTilingRatioValue = 1.3862943611198906188344642429164f;
struct WorkSizeInfo {
@ -55,7 +53,7 @@ struct WorkSizeInfo {
float targetRatio = 0;
WorkSizeInfo(uint32_t maxWorkGroupSize, bool hasBarriers, uint32_t simdSize, uint32_t slmTotalSize, const HardwareInfo *hwInfo, uint32_t numThreadsPerSubSlice, uint32_t localMemSize, bool imgUsed, bool yTiledSurface);
WorkSizeInfo(const DispatchInfo &dispatchInfo);
void setIfUseImg(const KernelInfo &kernelInfo);
void setMinWorkGroupSize(const HardwareInfo *hwInfo);
void checkRatio(const size_t workItems[3]);

View File

@ -7,7 +7,7 @@
#include "shared/source/program/program_info.h"
#include "opencl/source/program/kernel_info.h"
#include "shared/source/program/kernel_info.h"
namespace NEO {

View File

@ -10,9 +10,9 @@
#include "shared/source/compiler_interface/linker.h"
#include "shared/source/debug_settings/debug_settings_manager.h"
#include "shared/source/device_binary_format/patchtokens_decoder.h"
#include "shared/source/program/kernel_info.h"
#include "shared/source/program/program_info.h"
#include "opencl/source/program/kernel_info.h"
#include "opencl/source/program/kernel_info_from_patchtokens.h"
namespace NEO {

View File

@ -10,11 +10,11 @@
#include "shared/source/device_binary_format/zebin_decoder.h"
#include "shared/source/helpers/ptr_math.h"
#include "shared/source/helpers/string.h"
#include "shared/source/program/kernel_info.h"
#include "shared/source/program/program_info.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/unit_test/device_binary_format/zebin_tests.h"
#include "opencl/source/program/kernel_info.h"
#include "test.h"
#include <vector>

View File

@ -7,13 +7,12 @@
#include "shared/source/compiler_interface/linker.h"
#include "shared/source/device_binary_format/patchtokens_decoder.h"
#include "shared/source/program/kernel_info.h"
#include "shared/source/program/program_info.h"
#include "shared/source/program/program_info_from_patchtokens.h"
#include "shared/test/unit_test/compiler_interface/linker_mock.h"
#include "shared/test/unit_test/device_binary_format/patchtokens_tests.h"
#include "opencl/source/program/kernel_info.h"
#include "RelocationInfo.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"

View File

@ -5,9 +5,9 @@
*
*/
#include "shared/source/program/kernel_info.h"
#include "shared/source/program/program_info.h"
#include "opencl/source/program/kernel_info.h"
#include "opencl/test/unit_test/mocks/mock_kernel.h"
#include "gmock/gmock.h"
@ -59,4 +59,4 @@ TEST(RequiresLocalMemoryWindowVA, GivenProgramWithKernelsWhenSomeOfKernelRequire
programInfo.kernelInfos = {new NEO::KernelInfo(), new NEO::KernelInfo(), new NEO::KernelInfo()};
programInfo.kernelInfos[1]->kernelDescriptor.payloadMappings.implicitArgs.localMemoryStatelessWindowStartAddres = 0U;
EXPECT_TRUE(NEO::requiresLocalMemoryWindowVA(programInfo));
}
}