2020-07-30 19:18:54 +08:00
|
|
|
/*
|
2022-01-19 17:57:56 +08:00
|
|
|
* Copyright (C) 2020-2022 Intel Corporation
|
2020-07-30 19:18:54 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "shared/source/device_binary_format/elf/elf.h"
|
2021-07-02 22:28:08 +08:00
|
|
|
#include "shared/source/device_binary_format/elf/elf_decoder.h"
|
2020-07-30 19:18:54 +08:00
|
|
|
#include "shared/source/utilities/const_stringref.h"
|
|
|
|
|
|
|
|
#include <inttypes.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
namespace NEO {
|
|
|
|
|
|
|
|
namespace Elf {
|
|
|
|
|
|
|
|
enum ELF_TYPE_ZEBIN : uint16_t {
|
|
|
|
ET_ZEBIN_REL = 0xff11, // A relocatable ZE binary file
|
|
|
|
ET_ZEBIN_EXE = 0xff12, // An executable ZE binary file
|
|
|
|
ET_ZEBIN_DYN = 0xff13, // A shared object ZE binary file
|
|
|
|
};
|
|
|
|
|
|
|
|
enum SHT_ZEBIN : uint32_t {
|
2021-12-03 18:52:01 +08:00
|
|
|
SHT_ZEBIN_SPIRV = 0xff000009, // .spv.kernel section, value the same as SHT_OPENCL_SPIRV
|
|
|
|
SHT_ZEBIN_ZEINFO = 0xff000011, // .ze_info section
|
|
|
|
SHT_ZEBIN_GTPIN_INFO = 0xff000012, // .gtpin_info section
|
2022-04-25 20:12:15 +08:00
|
|
|
SHT_ZEBIN_VISA_ASM = 0xff000013, // .visaasm sections
|
|
|
|
SHT_ZEBIN_MISC = 0xff000014 // .misc section
|
2020-07-30 19:18:54 +08:00
|
|
|
};
|
|
|
|
|
2021-07-15 20:03:00 +08:00
|
|
|
enum RELOC_TYPE_ZEBIN : uint32_t {
|
|
|
|
R_ZE_NONE,
|
|
|
|
R_ZE_SYM_ADDR,
|
|
|
|
R_ZE_SYM_ADDR_32,
|
|
|
|
R_ZE_SYM_ADDR_32_HI,
|
|
|
|
R_PER_THREAD_PAYLOAD_OFFSET
|
|
|
|
};
|
|
|
|
|
2020-07-30 19:18:54 +08:00
|
|
|
namespace SectionsNamesZebin {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef textPrefix = ".text.";
|
|
|
|
constexpr ConstStringRef functions = ".text.Intel_Symbol_Table_Void_Program";
|
|
|
|
constexpr ConstStringRef dataConst = ".data.const";
|
|
|
|
constexpr ConstStringRef dataGlobalConst = ".data.global_const";
|
|
|
|
constexpr ConstStringRef dataGlobal = ".data.global";
|
|
|
|
constexpr ConstStringRef dataConstString = ".data.const.string";
|
|
|
|
constexpr ConstStringRef symtab = ".symtab";
|
|
|
|
constexpr ConstStringRef relTablePrefix = ".rel.";
|
|
|
|
constexpr ConstStringRef spv = ".spv";
|
|
|
|
constexpr ConstStringRef debugPrefix = ".debug_";
|
|
|
|
constexpr ConstStringRef debugInfo = ".debug_info";
|
|
|
|
constexpr ConstStringRef debugAbbrev = ".debug_abbrev";
|
|
|
|
constexpr ConstStringRef zeInfo = ".ze_info";
|
|
|
|
constexpr ConstStringRef gtpinInfo = ".gtpin_info";
|
|
|
|
constexpr ConstStringRef noteIntelGT = ".note.intelgt.compat";
|
|
|
|
constexpr ConstStringRef buildOptions = ".misc.buildOptions";
|
|
|
|
constexpr ConstStringRef vIsaAsmPrefix = ".visaasm.";
|
|
|
|
constexpr ConstStringRef externalFunctions = "Intel_Symbol_Table_Void_Program";
|
2020-07-30 19:18:54 +08:00
|
|
|
} // namespace SectionsNamesZebin
|
|
|
|
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef IntelGtNoteOwnerName = "IntelGT";
|
2021-07-02 22:28:08 +08:00
|
|
|
enum IntelGTSectionType : uint32_t {
|
|
|
|
ProductFamily = 1,
|
|
|
|
GfxCore = 2,
|
2022-07-26 22:37:45 +08:00
|
|
|
TargetMetadata = 3,
|
2022-08-10 19:54:18 +08:00
|
|
|
ZebinVersion = 4,
|
|
|
|
LastSupported = ZebinVersion
|
2022-07-26 22:37:45 +08:00
|
|
|
};
|
|
|
|
struct IntelGTNote {
|
|
|
|
IntelGTSectionType type;
|
|
|
|
ArrayRef<const uint8_t> data;
|
2021-07-02 22:28:08 +08:00
|
|
|
};
|
2020-07-30 19:18:54 +08:00
|
|
|
struct ZebinTargetFlags {
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
// bit[7:0]: dedicated for specific generator (meaning based on generatorId)
|
|
|
|
uint8_t generatorSpecificFlags : 8;
|
|
|
|
|
|
|
|
// bit[12:8]: values [0-31], min compatbile device revision Id (stepping)
|
|
|
|
uint8_t minHwRevisionId : 5;
|
|
|
|
|
|
|
|
// bit[13:13]:
|
|
|
|
// 0 - full validation during decoding (safer decoding)
|
|
|
|
// 1 - no validation (faster decoding - recommended for known generators)
|
|
|
|
bool validateRevisionId : 1;
|
|
|
|
|
|
|
|
// bit[14:14]:
|
|
|
|
// 0 - ignore minHwRevisionId and maxHwRevisionId
|
|
|
|
// 1 - underlying device must match specified revisionId info
|
|
|
|
bool disableExtendedValidation : 1;
|
|
|
|
|
|
|
|
// bit[15:15]:
|
|
|
|
// 0 - elfFileHeader::machine is PRODUCT_FAMILY
|
|
|
|
// 1 - elfFileHeader::machine is GFXCORE_FAMILY
|
|
|
|
bool machineEntryUsesGfxCoreInsteadOfProductFamily : 1;
|
|
|
|
|
|
|
|
// bit[20:16]: max compatbile device revision Id (stepping)
|
|
|
|
uint8_t maxHwRevisionId : 5;
|
|
|
|
|
|
|
|
// bit[23:21]: generator of this device binary
|
|
|
|
// 0 - Unregistered
|
|
|
|
// 1 - IGC
|
|
|
|
uint8_t generatorId : 3;
|
|
|
|
|
|
|
|
// bit[31:24]: MBZ, reserved for future use
|
|
|
|
};
|
|
|
|
uint32_t packed = 0U;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
static_assert(sizeof(ZebinTargetFlags) == sizeof(uint32_t), "");
|
|
|
|
|
|
|
|
namespace ZebinKernelMetadata {
|
|
|
|
namespace Tags {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef kernels("kernels");
|
|
|
|
constexpr ConstStringRef version("version");
|
|
|
|
constexpr ConstStringRef globalHostAccessTable("global_host_access_table");
|
|
|
|
constexpr ConstStringRef functions("functions");
|
2022-03-01 01:44:06 +08:00
|
|
|
|
2020-07-30 19:18:54 +08:00
|
|
|
namespace Kernel {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef name("name");
|
|
|
|
constexpr ConstStringRef executionEnv("execution_env");
|
|
|
|
constexpr ConstStringRef debugEnv("debug_env");
|
|
|
|
constexpr ConstStringRef payloadArguments("payload_arguments");
|
|
|
|
constexpr ConstStringRef bindingTableIndices("binding_table_indices");
|
|
|
|
constexpr ConstStringRef perThreadPayloadArguments("per_thread_payload_arguments");
|
|
|
|
constexpr ConstStringRef perThreadMemoryBuffers("per_thread_memory_buffers");
|
|
|
|
constexpr ConstStringRef experimentalProperties("experimental_properties");
|
2020-07-30 19:18:54 +08:00
|
|
|
|
|
|
|
namespace ExecutionEnv {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef barrierCount("barrier_count");
|
|
|
|
constexpr ConstStringRef disableMidThreadPreemption("disable_mid_thread_preemption");
|
|
|
|
constexpr ConstStringRef grfCount("grf_count");
|
|
|
|
constexpr ConstStringRef has4gbBuffers("has_4gb_buffers");
|
|
|
|
constexpr ConstStringRef hasDpas("has_dpas");
|
|
|
|
constexpr ConstStringRef hasFenceForImageAccess("has_fence_for_image_access");
|
|
|
|
constexpr ConstStringRef hasGlobalAtomics("has_global_atomics");
|
|
|
|
constexpr ConstStringRef hasMultiScratchSpaces("has_multi_scratch_spaces");
|
|
|
|
constexpr ConstStringRef hasNoStatelessWrite("has_no_stateless_write");
|
|
|
|
constexpr ConstStringRef hasStackCalls("has_stack_calls");
|
|
|
|
constexpr ConstStringRef hwPreemptionMode("hw_preemption_mode");
|
|
|
|
constexpr ConstStringRef inlineDataPayloadSize("inline_data_payload_size");
|
|
|
|
constexpr ConstStringRef offsetToSkipPerThreadDataLoad("offset_to_skip_per_thread_data_load");
|
|
|
|
constexpr ConstStringRef offsetToSkipSetFfidGp("offset_to_skip_set_ffid_gp");
|
|
|
|
constexpr ConstStringRef requiredSubGroupSize("required_sub_group_size");
|
|
|
|
constexpr ConstStringRef requiredWorkGroupSize("required_work_group_size");
|
|
|
|
constexpr ConstStringRef requireDisableEUFusion("require_disable_eufusion");
|
|
|
|
constexpr ConstStringRef simdSize("simd_size");
|
|
|
|
constexpr ConstStringRef slmSize("slm_size");
|
|
|
|
constexpr ConstStringRef subgroupIndependentForwardProgress("subgroup_independent_forward_progress");
|
|
|
|
constexpr ConstStringRef workGroupWalkOrderDimensions("work_group_walk_order_dimensions");
|
|
|
|
constexpr ConstStringRef threadSchedulingMode("thread_scheduling_mode");
|
2022-08-12 22:58:41 +08:00
|
|
|
namespace ThreadSchedulingMode {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef ageBased("age_based");
|
|
|
|
constexpr ConstStringRef roundRobin("round_robin");
|
|
|
|
constexpr ConstStringRef roundRobinStall("round_robin_stall");
|
2022-08-12 22:58:41 +08:00
|
|
|
} // namespace ThreadSchedulingMode
|
2020-07-30 19:18:54 +08:00
|
|
|
} // namespace ExecutionEnv
|
|
|
|
|
2021-08-30 21:59:08 +08:00
|
|
|
namespace DebugEnv {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef debugSurfaceBTI("sip_surface_bti");
|
2021-08-30 21:59:08 +08:00
|
|
|
} // namespace DebugEnv
|
|
|
|
|
2020-07-30 19:18:54 +08:00
|
|
|
namespace PayloadArgument {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef argType("arg_type");
|
|
|
|
constexpr ConstStringRef argIndex("arg_index");
|
|
|
|
constexpr ConstStringRef offset("offset");
|
|
|
|
constexpr ConstStringRef size("size");
|
|
|
|
constexpr ConstStringRef addrmode("addrmode");
|
|
|
|
constexpr ConstStringRef addrspace("addrspace");
|
|
|
|
constexpr ConstStringRef accessType("access_type");
|
|
|
|
constexpr ConstStringRef samplerIndex("sampler_index");
|
|
|
|
constexpr ConstStringRef sourceOffset("source_offset");
|
|
|
|
constexpr ConstStringRef slmArgAlignment("slm_alignment");
|
|
|
|
constexpr ConstStringRef imageType("image_type");
|
|
|
|
constexpr ConstStringRef imageTransformable("image_transformable");
|
|
|
|
constexpr ConstStringRef samplerType("sampler_type");
|
2022-08-11 00:11:49 +08:00
|
|
|
|
2020-07-30 19:18:54 +08:00
|
|
|
namespace ArgType {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef localSize("local_size");
|
|
|
|
constexpr ConstStringRef groupCount("group_count");
|
|
|
|
constexpr ConstStringRef globalIdOffset("global_id_offset");
|
|
|
|
constexpr ConstStringRef globalSize("global_size");
|
|
|
|
constexpr ConstStringRef enqueuedLocalSize("enqueued_local_size");
|
|
|
|
constexpr ConstStringRef privateBaseStateless("private_base_stateless");
|
|
|
|
constexpr ConstStringRef argByvalue("arg_byvalue");
|
|
|
|
constexpr ConstStringRef argBypointer("arg_bypointer");
|
|
|
|
constexpr ConstStringRef bufferAddress("buffer_address");
|
|
|
|
constexpr ConstStringRef bufferOffset("buffer_offset");
|
|
|
|
constexpr ConstStringRef printfBuffer("printf_buffer");
|
|
|
|
constexpr ConstStringRef workDimensions("work_dimensions");
|
|
|
|
constexpr ConstStringRef implicitArgBuffer("implicit_arg_buffer");
|
2022-08-10 01:17:54 +08:00
|
|
|
namespace Image {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef width("image_width");
|
|
|
|
constexpr ConstStringRef height("image_height");
|
|
|
|
constexpr ConstStringRef depth("image_depth");
|
|
|
|
constexpr ConstStringRef channelDataType("image_channel_data_type");
|
|
|
|
constexpr ConstStringRef channelOrder("image_channel_order");
|
|
|
|
constexpr ConstStringRef arraySize("image_array_size");
|
|
|
|
constexpr ConstStringRef numSamples("image_num_samples");
|
|
|
|
constexpr ConstStringRef numMipLevels("image_num_mip_levels");
|
|
|
|
constexpr ConstStringRef flatBaseOffset("flat_image_baseoffset");
|
|
|
|
constexpr ConstStringRef flatWidth("flat_image_width");
|
|
|
|
constexpr ConstStringRef flatHeight("flat_image_height");
|
|
|
|
constexpr ConstStringRef flatPitch("flat_image_pitch");
|
2022-08-10 01:17:54 +08:00
|
|
|
} // namespace Image
|
2022-08-11 00:11:49 +08:00
|
|
|
namespace Sampler {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef snapWa("sampler_snap_wa");
|
|
|
|
constexpr ConstStringRef normCoords("sampler_normalized");
|
|
|
|
constexpr ConstStringRef addrMode("sampler_address");
|
2022-08-11 00:11:49 +08:00
|
|
|
namespace Vme {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef blockType("vme_mb_block_type");
|
|
|
|
constexpr ConstStringRef subpixelMode("vme_subpixel_mode");
|
|
|
|
constexpr ConstStringRef sadAdjustMode("vme_sad_adjust_mode");
|
|
|
|
constexpr ConstStringRef searchPathType("vme_search_path_type");
|
2022-08-11 00:11:49 +08:00
|
|
|
} // namespace Vme
|
|
|
|
} // namespace Sampler
|
2020-07-30 19:18:54 +08:00
|
|
|
} // namespace ArgType
|
2022-08-10 01:17:54 +08:00
|
|
|
namespace ImageType {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef imageTypeBuffer("image_buffer");
|
|
|
|
constexpr ConstStringRef imageType1D("image_1d");
|
|
|
|
constexpr ConstStringRef imageType1DArray("image_1d_array");
|
|
|
|
constexpr ConstStringRef imageType2D("image_2d");
|
|
|
|
constexpr ConstStringRef imageType2DArray("image_2d_array");
|
|
|
|
constexpr ConstStringRef imageType3D("image_3d");
|
|
|
|
constexpr ConstStringRef imageTypeCube("image_cube_array");
|
|
|
|
constexpr ConstStringRef imageTypeCubeArray("image_buffer");
|
|
|
|
constexpr ConstStringRef imageType2DDepth("image_2d_depth");
|
|
|
|
constexpr ConstStringRef imageType2DArrayDepth("image_2d_array_depth");
|
|
|
|
constexpr ConstStringRef imageType2DMSAA("image_2d_msaa");
|
|
|
|
constexpr ConstStringRef imageType2DMSAADepth("image_2d_msaa_depth");
|
|
|
|
constexpr ConstStringRef imageType2DArrayMSAA("image_2d_array_msaa");
|
|
|
|
constexpr ConstStringRef imageType2DArrayMSAADepth("image_2d_array_msaa_depth");
|
|
|
|
constexpr ConstStringRef imageType2DMedia("image_2d_media");
|
|
|
|
constexpr ConstStringRef imageType2DMediaBlock("image_2d_media_block");
|
2022-08-10 01:17:54 +08:00
|
|
|
} // namespace ImageType
|
2022-08-11 00:11:49 +08:00
|
|
|
namespace SamplerType {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef samplerTypeTexture("texture");
|
|
|
|
constexpr ConstStringRef samplerType8x8("sample_8x8");
|
|
|
|
constexpr ConstStringRef samplerType2DConsolve8x8("sample_8x8_2dconvolve");
|
|
|
|
constexpr ConstStringRef samplerTypeErode8x8("sample_8x8_erode");
|
|
|
|
constexpr ConstStringRef samplerTypeDilate8x8("sample_8x8_dilate");
|
|
|
|
constexpr ConstStringRef samplerTypeMinMaxFilter8x8("sample_8x8_minmaxfilter");
|
|
|
|
constexpr ConstStringRef samplerTypeCentroid8x8("sample_8x8_centroid");
|
|
|
|
constexpr ConstStringRef samplerTypeBoolCentroid8x8("sample_8x8_bool_centroid");
|
|
|
|
constexpr ConstStringRef samplerTypeBoolSum8x8("sample_8x8_bool_sum");
|
|
|
|
constexpr ConstStringRef samplerTypeVD("vd");
|
|
|
|
constexpr ConstStringRef samplerTypeVE("ve");
|
|
|
|
constexpr ConstStringRef samplerTypeVME("vme");
|
2022-08-11 00:11:49 +08:00
|
|
|
} // namespace SamplerType
|
2020-07-30 19:18:54 +08:00
|
|
|
namespace MemoryAddressingMode {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef stateless("stateless");
|
|
|
|
constexpr ConstStringRef stateful("stateful");
|
|
|
|
constexpr ConstStringRef bindless("bindless");
|
|
|
|
constexpr ConstStringRef sharedLocalMemory("slm");
|
2020-07-30 19:18:54 +08:00
|
|
|
} // namespace MemoryAddressingMode
|
|
|
|
namespace AddrSpace {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef global("global");
|
|
|
|
constexpr ConstStringRef local("local");
|
|
|
|
constexpr ConstStringRef constant("constant");
|
|
|
|
constexpr ConstStringRef image("image");
|
|
|
|
constexpr ConstStringRef sampler("sampler");
|
2020-07-30 19:18:54 +08:00
|
|
|
} // namespace AddrSpace
|
|
|
|
namespace AccessType {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef readonly("readonly");
|
|
|
|
constexpr ConstStringRef writeonly("writeonly");
|
|
|
|
constexpr ConstStringRef readwrite("readwrite");
|
2020-07-30 19:18:54 +08:00
|
|
|
} // namespace AccessType
|
|
|
|
} // namespace PayloadArgument
|
|
|
|
|
|
|
|
namespace BindingTableIndex {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef btiValue("bti_value");
|
|
|
|
constexpr ConstStringRef argIndex("arg_index");
|
2020-07-30 19:18:54 +08:00
|
|
|
} // namespace BindingTableIndex
|
|
|
|
|
|
|
|
namespace PerThreadPayloadArgument {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef argType("arg_type");
|
|
|
|
constexpr ConstStringRef offset("offset");
|
|
|
|
constexpr ConstStringRef size("size");
|
2020-07-30 19:18:54 +08:00
|
|
|
namespace ArgType {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef packedLocalIds("packed_local_ids");
|
|
|
|
constexpr ConstStringRef localId("local_id");
|
2020-07-30 19:18:54 +08:00
|
|
|
} // namespace ArgType
|
|
|
|
} // namespace PerThreadPayloadArgument
|
2020-08-30 14:50:00 +08:00
|
|
|
|
|
|
|
namespace PerThreadMemoryBuffer {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef allocationType("type");
|
|
|
|
constexpr ConstStringRef memoryUsage("usage");
|
|
|
|
constexpr ConstStringRef size("size");
|
|
|
|
constexpr ConstStringRef isSimtThread("is_simt_thread");
|
|
|
|
constexpr ConstStringRef slot("slot");
|
2020-08-30 14:50:00 +08:00
|
|
|
namespace AllocationType {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef global("global");
|
|
|
|
constexpr ConstStringRef scratch("scratch");
|
|
|
|
constexpr ConstStringRef slm("slm");
|
2020-08-30 14:50:00 +08:00
|
|
|
} // namespace AllocationType
|
|
|
|
namespace MemoryUsage {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef privateSpace("private_space");
|
|
|
|
constexpr ConstStringRef spillFillSpace("spill_fill_space");
|
|
|
|
constexpr ConstStringRef singleSpace("single_space");
|
2020-08-30 14:50:00 +08:00
|
|
|
} // namespace MemoryUsage
|
|
|
|
} // namespace PerThreadMemoryBuffer
|
2021-01-14 09:19:44 +08:00
|
|
|
namespace ExperimentalProperties {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef hasNonKernelArgLoad("has_non_kernel_arg_load");
|
|
|
|
constexpr ConstStringRef hasNonKernelArgStore("has_non_kernel_arg_store");
|
|
|
|
constexpr ConstStringRef hasNonKernelArgAtomic("has_non_kernel_arg_atomic");
|
2021-01-14 09:19:44 +08:00
|
|
|
} // namespace ExperimentalProperties
|
2020-07-30 19:18:54 +08:00
|
|
|
} // namespace Kernel
|
2022-03-01 01:44:06 +08:00
|
|
|
|
2022-02-23 19:48:31 +08:00
|
|
|
namespace GlobalHostAccessTable {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef deviceName("device_name");
|
|
|
|
constexpr ConstStringRef hostName("host_name");
|
2022-02-23 19:48:31 +08:00
|
|
|
} // namespace GlobalHostAccessTable
|
2022-03-01 01:44:06 +08:00
|
|
|
|
|
|
|
namespace Function {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef name("name");
|
|
|
|
constexpr ConstStringRef executionEnv("execution_env");
|
2022-03-01 01:44:06 +08:00
|
|
|
using namespace Kernel::ExecutionEnv;
|
|
|
|
} // namespace Function
|
|
|
|
|
2020-07-30 19:18:54 +08:00
|
|
|
} // namespace Tags
|
|
|
|
|
|
|
|
namespace Types {
|
|
|
|
|
2020-10-05 01:18:49 +08:00
|
|
|
struct Version {
|
|
|
|
uint32_t major = 0U;
|
|
|
|
uint32_t minor = 0U;
|
|
|
|
};
|
|
|
|
|
2020-07-30 19:18:54 +08:00
|
|
|
namespace Kernel {
|
|
|
|
namespace ExecutionEnv {
|
2022-08-12 22:58:41 +08:00
|
|
|
enum ThreadSchedulingMode : uint8_t {
|
|
|
|
ThreadSchedulingModeUnknown,
|
|
|
|
ThreadSchedulingModeAgeBased,
|
|
|
|
ThreadSchedulingModeRoundRobin,
|
|
|
|
ThreadSchedulingModeRoundRobinStall,
|
|
|
|
ThreadSchedulingModeMax
|
|
|
|
};
|
|
|
|
|
2020-07-30 19:18:54 +08:00
|
|
|
using ActualKernelStartOffsetT = int32_t;
|
|
|
|
using BarrierCountT = int32_t;
|
|
|
|
using DisableMidThreadPreemptionT = bool;
|
|
|
|
using GrfCountT = int32_t;
|
|
|
|
using Has4GBBuffersT = bool;
|
2021-10-25 16:52:17 +08:00
|
|
|
using HasDpasT = bool;
|
2020-07-30 19:18:54 +08:00
|
|
|
using HasFenceForImageAccessT = bool;
|
|
|
|
using HasGlobalAtomicsT = bool;
|
|
|
|
using HasMultiScratchSpacesT = bool;
|
2021-11-10 19:56:49 +08:00
|
|
|
using HasNonKernelArgAtomicT = int32_t;
|
|
|
|
using HasNonKernelArgLoadT = int32_t;
|
|
|
|
using HasNonKernelArgStoreT = int32_t;
|
2020-07-30 19:18:54 +08:00
|
|
|
using HasNoStatelessWriteT = bool;
|
2021-11-09 20:45:57 +08:00
|
|
|
using HasStackCallsT = bool;
|
2020-07-30 19:18:54 +08:00
|
|
|
using HwPreemptionModeT = int32_t;
|
2021-11-22 19:06:16 +08:00
|
|
|
using InlineDataPayloadSizeT = int32_t;
|
2020-07-30 19:18:54 +08:00
|
|
|
using OffsetToSkipPerThreadDataLoadT = int32_t;
|
|
|
|
using OffsetToSkipSetFfidGpT = int32_t;
|
|
|
|
using RequiredSubGroupSizeT = int32_t;
|
|
|
|
using RequiredWorkGroupSizeT = int32_t[3];
|
2022-02-11 07:33:40 +08:00
|
|
|
using RequireDisableEUFusionT = bool;
|
2020-07-30 19:18:54 +08:00
|
|
|
using SimdSizeT = int32_t;
|
|
|
|
using SlmSizeT = int32_t;
|
|
|
|
using SubgroupIndependentForwardProgressT = bool;
|
|
|
|
using WorkgroupWalkOrderDimensionsT = int32_t[3];
|
2022-08-12 22:58:41 +08:00
|
|
|
using ThreadSchedulingModeT = ThreadSchedulingMode;
|
2020-07-30 19:18:54 +08:00
|
|
|
|
|
|
|
namespace Defaults {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr BarrierCountT barrierCount = 0;
|
|
|
|
constexpr DisableMidThreadPreemptionT disableMidThreadPreemption = false;
|
|
|
|
constexpr Has4GBBuffersT has4GBBuffers = false;
|
|
|
|
constexpr HasDpasT hasDpas = false;
|
|
|
|
constexpr HasFenceForImageAccessT hasFenceForImageAccess = false;
|
|
|
|
constexpr HasGlobalAtomicsT hasGlobalAtomics = false;
|
|
|
|
constexpr HasMultiScratchSpacesT hasMultiScratchSpaces = false;
|
|
|
|
constexpr HasNonKernelArgAtomicT hasNonKernelArgAtomic = false;
|
|
|
|
constexpr HasNonKernelArgLoadT hasNonKernelArgLoad = false;
|
|
|
|
constexpr HasNonKernelArgStoreT hasNonKernelArgStore = false;
|
|
|
|
constexpr HasNoStatelessWriteT hasNoStatelessWrite = false;
|
|
|
|
constexpr HasStackCallsT hasStackCalls = false;
|
|
|
|
constexpr HwPreemptionModeT hwPreemptionMode = -1;
|
|
|
|
constexpr InlineDataPayloadSizeT inlineDataPayloadSize = 0;
|
|
|
|
constexpr OffsetToSkipPerThreadDataLoadT offsetToSkipPerThreadDataLoad = 0;
|
|
|
|
constexpr OffsetToSkipSetFfidGpT offsetToSkipSetFfidGp = 0;
|
|
|
|
constexpr RequiredSubGroupSizeT requiredSubGroupSize = 0;
|
|
|
|
constexpr RequiredWorkGroupSizeT requiredWorkGroupSize = {0, 0, 0};
|
|
|
|
constexpr RequireDisableEUFusionT requireDisableEUFusion = false;
|
|
|
|
constexpr SlmSizeT slmSize = 0;
|
|
|
|
constexpr SubgroupIndependentForwardProgressT subgroupIndependentForwardProgress = false;
|
|
|
|
constexpr WorkgroupWalkOrderDimensionsT workgroupWalkOrderDimensions = {0, 1, 2};
|
|
|
|
constexpr ThreadSchedulingModeT threadSchedulingMode = ThreadSchedulingModeUnknown;
|
2020-07-30 19:18:54 +08:00
|
|
|
} // namespace Defaults
|
|
|
|
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ConstStringRef required[] = {
|
2020-07-30 19:18:54 +08:00
|
|
|
Tags::Kernel::ExecutionEnv::grfCount,
|
|
|
|
Tags::Kernel::ExecutionEnv::simdSize};
|
|
|
|
|
|
|
|
struct ExecutionEnvBaseT {
|
|
|
|
BarrierCountT barrierCount = Defaults::barrierCount;
|
|
|
|
DisableMidThreadPreemptionT disableMidThreadPreemption = Defaults::disableMidThreadPreemption;
|
|
|
|
GrfCountT grfCount = -1;
|
|
|
|
Has4GBBuffersT has4GBBuffers = Defaults::has4GBBuffers;
|
2021-10-25 16:52:17 +08:00
|
|
|
HasDpasT hasDpas = Defaults::hasDpas;
|
2020-07-30 19:18:54 +08:00
|
|
|
HasFenceForImageAccessT hasFenceForImageAccess = Defaults::hasFenceForImageAccess;
|
|
|
|
HasGlobalAtomicsT hasGlobalAtomics = Defaults::hasGlobalAtomics;
|
|
|
|
HasMultiScratchSpacesT hasMultiScratchSpaces = Defaults::hasMultiScratchSpaces;
|
|
|
|
HasNoStatelessWriteT hasNoStatelessWrite = Defaults::hasNoStatelessWrite;
|
2021-11-09 20:45:57 +08:00
|
|
|
HasStackCallsT hasStackCalls = Defaults::hasStackCalls;
|
2020-07-30 19:18:54 +08:00
|
|
|
HwPreemptionModeT hwPreemptionMode = Defaults::hwPreemptionMode;
|
2021-11-22 19:06:16 +08:00
|
|
|
InlineDataPayloadSizeT inlineDataPayloadSize = Defaults::inlineDataPayloadSize;
|
2020-07-30 19:18:54 +08:00
|
|
|
OffsetToSkipPerThreadDataLoadT offsetToSkipPerThreadDataLoad = Defaults::offsetToSkipPerThreadDataLoad;
|
|
|
|
OffsetToSkipSetFfidGpT offsetToSkipSetFfidGp = Defaults::offsetToSkipSetFfidGp;
|
|
|
|
RequiredSubGroupSizeT requiredSubGroupSize = Defaults::requiredSubGroupSize;
|
|
|
|
RequiredWorkGroupSizeT requiredWorkGroupSize = {Defaults::requiredWorkGroupSize[0], Defaults::requiredWorkGroupSize[1], Defaults::requiredWorkGroupSize[2]};
|
2022-02-11 07:33:40 +08:00
|
|
|
RequireDisableEUFusionT requireDisableEUFusion = Defaults::requireDisableEUFusion;
|
2020-07-30 19:18:54 +08:00
|
|
|
SimdSizeT simdSize = -1;
|
|
|
|
SlmSizeT slmSize = Defaults::slmSize;
|
|
|
|
SubgroupIndependentForwardProgressT subgroupIndependentForwardProgress = Defaults::subgroupIndependentForwardProgress;
|
|
|
|
WorkgroupWalkOrderDimensionsT workgroupWalkOrderDimensions{Defaults::workgroupWalkOrderDimensions[0], Defaults::workgroupWalkOrderDimensions[1], Defaults::workgroupWalkOrderDimensions[2]};
|
2022-08-12 22:58:41 +08:00
|
|
|
ThreadSchedulingModeT threadSchedulingMode = Defaults::threadSchedulingMode;
|
2020-07-30 19:18:54 +08:00
|
|
|
};
|
|
|
|
|
2021-01-14 09:19:44 +08:00
|
|
|
struct ExperimentalPropertiesBaseT {
|
2021-11-10 19:56:49 +08:00
|
|
|
HasNonKernelArgLoadT hasNonKernelArgLoad = Defaults::hasNonKernelArgLoad;
|
|
|
|
HasNonKernelArgStoreT hasNonKernelArgStore = Defaults::hasNonKernelArgStore;
|
|
|
|
HasNonKernelArgAtomicT hasNonKernelArgAtomic = Defaults::hasNonKernelArgAtomic;
|
2021-01-14 09:19:44 +08:00
|
|
|
};
|
|
|
|
|
2020-07-30 19:18:54 +08:00
|
|
|
} // namespace ExecutionEnv
|
|
|
|
|
2021-08-30 21:59:08 +08:00
|
|
|
namespace DebugEnv {
|
|
|
|
using DebugSurfaceBTIT = int32_t;
|
|
|
|
|
|
|
|
namespace Defaults {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr DebugSurfaceBTIT debugSurfaceBTI = -1;
|
2021-08-30 21:59:08 +08:00
|
|
|
} // namespace Defaults
|
|
|
|
|
|
|
|
struct DebugEnvBaseT {
|
|
|
|
DebugSurfaceBTIT debugSurfaceBTI = Defaults::debugSurfaceBTI;
|
|
|
|
};
|
|
|
|
} // namespace DebugEnv
|
|
|
|
|
2020-07-30 19:18:54 +08:00
|
|
|
enum ArgType : uint8_t {
|
|
|
|
ArgTypeUnknown = 0,
|
|
|
|
ArgTypePackedLocalIds = 1,
|
|
|
|
ArgTypeLocalId,
|
|
|
|
ArgTypeLocalSize,
|
2020-08-19 19:07:34 +08:00
|
|
|
ArgTypeGroupCount,
|
|
|
|
ArgTypeGlobalSize,
|
|
|
|
ArgTypeEnqueuedLocalSize,
|
2020-07-30 19:18:54 +08:00
|
|
|
ArgTypeGlobalIdOffset,
|
|
|
|
ArgTypePrivateBaseStateless,
|
|
|
|
ArgTypeArgByvalue,
|
|
|
|
ArgTypeArgBypointer,
|
2022-06-04 00:01:33 +08:00
|
|
|
ArgTypeBufferAddress,
|
2021-03-17 22:31:36 +08:00
|
|
|
ArgTypeBufferOffset,
|
2021-07-16 18:31:05 +08:00
|
|
|
ArgTypePrintfBuffer,
|
2022-02-24 02:48:58 +08:00
|
|
|
ArgTypeWorkDimensions,
|
2022-08-10 01:17:54 +08:00
|
|
|
ArgTypeImplicitArgBuffer,
|
|
|
|
ArgTypeImageWidth,
|
|
|
|
ArgTypeImageHeight,
|
|
|
|
ArgTypeImageDepth,
|
|
|
|
ArgTypeImageChannelDataType,
|
|
|
|
ArgTypeImageChannelOrder,
|
|
|
|
ArgTypeImageArraySize,
|
|
|
|
ArgTypeImageNumSamples,
|
|
|
|
ArgTypeImageMipLevels,
|
|
|
|
ArgTypeImageFlatBaseOffset,
|
|
|
|
ArgTypeImageFlatWidth,
|
|
|
|
ArgTypeImageFlatHeight,
|
2022-08-10 02:46:36 +08:00
|
|
|
ArgTypeImageFlatPitch,
|
2022-08-11 00:11:49 +08:00
|
|
|
ArgTypeSamplerSnapWa,
|
|
|
|
ArgTypeSamplerNormCoords,
|
|
|
|
ArgTypeSamplerAddrMode,
|
|
|
|
ArgTypeVmeMbBlockType,
|
|
|
|
ArgTypeVmeSubpixelMode,
|
|
|
|
ArgTypeVmeSadAdjustMode,
|
|
|
|
ArgTypeVmeSearchPathType,
|
2022-08-10 02:46:36 +08:00
|
|
|
ArgTypeMax
|
2020-07-30 19:18:54 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
namespace PerThreadPayloadArgument {
|
|
|
|
|
|
|
|
using OffsetT = int32_t;
|
|
|
|
using SizeT = int32_t;
|
|
|
|
using ArgTypeT = ArgType;
|
|
|
|
|
|
|
|
namespace Defaults {
|
|
|
|
}
|
|
|
|
|
|
|
|
struct PerThreadPayloadArgumentBaseT {
|
|
|
|
ArgTypeT argType = ArgTypeUnknown;
|
|
|
|
OffsetT offset = -1;
|
|
|
|
SizeT size = -1;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace PerThreadPayloadArgument
|
|
|
|
|
|
|
|
namespace PayloadArgument {
|
|
|
|
|
|
|
|
enum MemoryAddressingMode : uint8_t {
|
|
|
|
MemoryAddressingModeUnknown = 0,
|
|
|
|
MemoryAddressingModeStateful = 1,
|
|
|
|
MemoryAddressingModeStateless,
|
|
|
|
MemoryAddressingModeBindless,
|
|
|
|
MemoryAddressingModeSharedLocalMemory,
|
2022-08-10 02:46:36 +08:00
|
|
|
MemoryAddressIngModeMax
|
2020-07-30 19:18:54 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
enum AddressSpace : uint8_t {
|
|
|
|
AddressSpaceUnknown = 0,
|
|
|
|
AddressSpaceGlobal = 1,
|
|
|
|
AddressSpaceLocal,
|
|
|
|
AddressSpaceConstant,
|
|
|
|
AddressSpaceImage,
|
|
|
|
AddressSpaceSampler,
|
2022-08-10 02:46:36 +08:00
|
|
|
AddressSpaceMax
|
2020-07-30 19:18:54 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
enum AccessType : uint8_t {
|
|
|
|
AccessTypeUnknown = 0,
|
|
|
|
AccessTypeReadonly = 1,
|
|
|
|
AccessTypeWriteonly,
|
|
|
|
AccessTypeReadwrite,
|
2022-08-10 02:46:36 +08:00
|
|
|
AccessTypeMax
|
2020-07-30 19:18:54 +08:00
|
|
|
};
|
|
|
|
|
2022-08-10 01:17:54 +08:00
|
|
|
enum ImageType : uint8_t {
|
|
|
|
ImageTypeUnknown,
|
2022-08-11 00:11:49 +08:00
|
|
|
ImageTypeBuffer,
|
|
|
|
ImageType1D,
|
|
|
|
ImageType1DArray,
|
|
|
|
ImageType2D,
|
|
|
|
ImageType2DArray,
|
|
|
|
ImageType3D,
|
|
|
|
ImageTypeCube,
|
|
|
|
ImageTypeCubeArray,
|
|
|
|
ImageType2DDepth,
|
|
|
|
ImageType2DArrayDepth,
|
|
|
|
ImageType2DMSAA,
|
|
|
|
ImageType2DMSAADepth,
|
|
|
|
ImageType2DArrayMSAA,
|
|
|
|
ImageType2DArrayMSAADepth,
|
|
|
|
ImageType2DMedia,
|
|
|
|
ImageType2DMediaBlock,
|
2022-08-10 02:46:36 +08:00
|
|
|
ImageTypeMax
|
2022-08-10 01:17:54 +08:00
|
|
|
};
|
|
|
|
|
2022-08-11 00:11:49 +08:00
|
|
|
enum SamplerType : uint8_t {
|
|
|
|
SamplerTypeUnknown,
|
|
|
|
SamplerTypeTexture,
|
|
|
|
SamplerType8x8,
|
|
|
|
SamplerType2DConvolve8x8,
|
|
|
|
SamplerTypeErode8x8,
|
|
|
|
SamplerTypeDilate8x8,
|
|
|
|
SamplerTypeMinMaxFilter8x8,
|
|
|
|
SamplerTypeCentroid8x8,
|
|
|
|
SamplerTypeBoolCentroid8x8,
|
|
|
|
SamplerTypeBoolSum8x8,
|
|
|
|
SamplerTypeVME,
|
|
|
|
SamplerTypeVE,
|
|
|
|
SamplerTypeVD,
|
|
|
|
SamplerTypeMax
|
|
|
|
};
|
|
|
|
|
2020-07-30 19:18:54 +08:00
|
|
|
using ArgTypeT = ArgType;
|
|
|
|
using OffseT = int32_t;
|
2021-12-15 22:32:25 +08:00
|
|
|
using SourceOffseT = int32_t;
|
2020-07-30 19:18:54 +08:00
|
|
|
using SizeT = int32_t;
|
|
|
|
using ArgIndexT = int32_t;
|
|
|
|
using AddrmodeT = MemoryAddressingMode;
|
|
|
|
using AddrspaceT = AddressSpace;
|
|
|
|
using AccessTypeT = AccessType;
|
2022-03-24 20:28:45 +08:00
|
|
|
using SlmAlignmentT = uint8_t;
|
2021-05-11 20:50:29 +08:00
|
|
|
using SamplerIndexT = int32_t;
|
2020-07-30 19:18:54 +08:00
|
|
|
|
|
|
|
namespace Defaults {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr ArgIndexT argIndex = -1;
|
|
|
|
constexpr SlmAlignmentT slmArgAlignment = 16U;
|
|
|
|
constexpr SamplerIndexT samplerIndex = -1;
|
|
|
|
constexpr SourceOffseT sourceOffset = -1;
|
2020-10-05 01:18:49 +08:00
|
|
|
} // namespace Defaults
|
2020-07-30 19:18:54 +08:00
|
|
|
|
|
|
|
struct PayloadArgumentBaseT {
|
|
|
|
ArgTypeT argType = ArgTypeUnknown;
|
|
|
|
OffseT offset = 0;
|
2021-12-15 22:32:25 +08:00
|
|
|
SourceOffseT sourceOffset = Defaults::sourceOffset;
|
2020-07-30 19:18:54 +08:00
|
|
|
SizeT size = 0;
|
|
|
|
ArgIndexT argIndex = Defaults::argIndex;
|
|
|
|
AddrmodeT addrmode = MemoryAddressingModeUnknown;
|
|
|
|
AddrspaceT addrspace = AddressSpaceUnknown;
|
|
|
|
AccessTypeT accessType = AccessTypeUnknown;
|
2021-05-11 20:50:29 +08:00
|
|
|
SamplerIndexT samplerIndex = Defaults::samplerIndex;
|
2022-03-24 20:28:45 +08:00
|
|
|
SlmAlignmentT slmArgAlignment = Defaults::slmArgAlignment;
|
2022-08-10 01:17:54 +08:00
|
|
|
ImageType imageType = ImageTypeUnknown;
|
|
|
|
bool imageTransformable = false;
|
2022-08-11 00:11:49 +08:00
|
|
|
SamplerType samplerType = SamplerTypeUnknown;
|
2020-07-30 19:18:54 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace PayloadArgument
|
|
|
|
|
|
|
|
namespace BindingTableEntry {
|
|
|
|
using BtiValueT = int32_t;
|
|
|
|
using ArgIndexT = int32_t;
|
|
|
|
struct BindingTableEntryBaseT {
|
|
|
|
BtiValueT btiValue = 0U;
|
|
|
|
ArgIndexT argIndex = 0U;
|
|
|
|
};
|
|
|
|
} // namespace BindingTableEntry
|
|
|
|
|
2020-08-30 14:50:00 +08:00
|
|
|
namespace PerThreadMemoryBuffer {
|
|
|
|
enum AllocationType : uint8_t {
|
|
|
|
AllocationTypeUnknown = 0,
|
|
|
|
AllocationTypeGlobal,
|
|
|
|
AllocationTypeScratch,
|
2022-08-10 02:46:36 +08:00
|
|
|
AllocationTypeSlm,
|
|
|
|
AllocationTypeMax
|
2020-08-30 14:50:00 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
enum MemoryUsage : uint8_t {
|
|
|
|
MemoryUsageUnknown = 0,
|
|
|
|
MemoryUsagePrivateSpace,
|
|
|
|
MemoryUsageSpillFillSpace,
|
2022-08-10 02:46:36 +08:00
|
|
|
MemoryUsageSingleSpace,
|
|
|
|
MemoryUsageMax
|
2020-08-30 14:50:00 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
using SizeT = int32_t;
|
|
|
|
using AllocationTypeT = AllocationType;
|
|
|
|
using MemoryUsageT = MemoryUsage;
|
2020-10-05 01:18:49 +08:00
|
|
|
using IsSimtThreadT = bool;
|
|
|
|
using Slot = int32_t;
|
|
|
|
|
|
|
|
namespace Defaults {
|
2022-08-26 20:39:52 +08:00
|
|
|
constexpr IsSimtThreadT isSimtThread = false;
|
|
|
|
constexpr Slot slot = 0U;
|
2020-10-05 01:18:49 +08:00
|
|
|
} // namespace Defaults
|
2020-08-30 14:50:00 +08:00
|
|
|
|
|
|
|
struct PerThreadMemoryBufferBaseT {
|
|
|
|
AllocationType allocationType = AllocationTypeUnknown;
|
|
|
|
MemoryUsageT memoryUsage = MemoryUsageUnknown;
|
|
|
|
SizeT size = 0U;
|
2020-10-05 01:18:49 +08:00
|
|
|
IsSimtThreadT isSimtThread = Defaults::isSimtThread;
|
|
|
|
Slot slot = Defaults::slot;
|
2020-08-30 14:50:00 +08:00
|
|
|
};
|
|
|
|
} // namespace PerThreadMemoryBuffer
|
|
|
|
|
2020-07-30 19:18:54 +08:00
|
|
|
} // namespace Kernel
|
|
|
|
|
2022-02-23 19:48:31 +08:00
|
|
|
namespace GlobalHostAccessTable {
|
|
|
|
struct globalHostAccessTableT {
|
|
|
|
std::string deviceName;
|
|
|
|
std::string hostName;
|
|
|
|
};
|
|
|
|
} // namespace GlobalHostAccessTable
|
2022-03-01 01:44:06 +08:00
|
|
|
|
|
|
|
namespace Function {
|
|
|
|
namespace ExecutionEnv {
|
|
|
|
using namespace Kernel::ExecutionEnv;
|
|
|
|
}
|
|
|
|
} // namespace Function
|
2020-07-30 19:18:54 +08:00
|
|
|
} // namespace Types
|
|
|
|
|
|
|
|
} // namespace ZebinKernelMetadata
|
|
|
|
|
|
|
|
} // namespace Elf
|
|
|
|
|
2020-10-13 19:14:51 +08:00
|
|
|
} // namespace NEO
|