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 {
|
|
|
|
static constexpr ConstStringRef textPrefix = ".text.";
|
2022-05-13 17:42:59 +08:00
|
|
|
static constexpr ConstStringRef functions = ".text.Intel_Symbol_Table_Void_Program";
|
2020-07-30 19:18:54 +08:00
|
|
|
static constexpr ConstStringRef dataConst = ".data.const";
|
2021-01-20 00:29:20 +08:00
|
|
|
static constexpr ConstStringRef dataGlobalConst = ".data.global_const";
|
2020-07-30 19:18:54 +08:00
|
|
|
static constexpr ConstStringRef dataGlobal = ".data.global";
|
2021-11-02 23:29:09 +08:00
|
|
|
static constexpr ConstStringRef dataConstString = ".data.const.string";
|
2020-07-30 19:18:54 +08:00
|
|
|
static constexpr ConstStringRef symtab = ".symtab";
|
|
|
|
static constexpr ConstStringRef relTablePrefix = ".rel.";
|
|
|
|
static constexpr ConstStringRef spv = ".spv";
|
2021-07-15 22:32:33 +08:00
|
|
|
static constexpr ConstStringRef debugPrefix = ".debug_";
|
2020-07-30 19:18:54 +08:00
|
|
|
static constexpr ConstStringRef debugInfo = ".debug_info";
|
2021-07-15 22:32:33 +08:00
|
|
|
static constexpr ConstStringRef debugAbbrev = ".debug_abbrev";
|
2020-07-30 19:18:54 +08:00
|
|
|
static constexpr ConstStringRef zeInfo = ".ze_info";
|
2020-09-07 09:05:13 +08:00
|
|
|
static constexpr ConstStringRef gtpinInfo = ".gtpin_info";
|
2021-07-02 22:28:08 +08:00
|
|
|
static constexpr ConstStringRef noteIntelGT = ".note.intelgt.compat";
|
2022-04-25 20:12:15 +08:00
|
|
|
static constexpr ConstStringRef buildOptions = ".misc.buildOptions";
|
2021-12-03 18:52:01 +08:00
|
|
|
static constexpr ConstStringRef vIsaAsmPrefix = ".visaasm.";
|
2022-03-01 01:44:06 +08:00
|
|
|
static constexpr ConstStringRef externalFunctions = "Intel_Symbol_Table_Void_Program";
|
2020-07-30 19:18:54 +08:00
|
|
|
} // namespace SectionsNamesZebin
|
|
|
|
|
2021-07-02 22:28:08 +08:00
|
|
|
static constexpr ConstStringRef IntelGtNoteOwnerName = "IntelGT";
|
|
|
|
struct IntelGTNote : ElfNoteSection {
|
|
|
|
char ownerName[8];
|
|
|
|
uint32_t desc;
|
|
|
|
};
|
|
|
|
static_assert(sizeof(IntelGTNote) == 0x18, "");
|
|
|
|
enum IntelGTSectionType : uint32_t {
|
|
|
|
ProductFamily = 1,
|
|
|
|
GfxCore = 2,
|
|
|
|
TargetMetadata = 3
|
|
|
|
};
|
|
|
|
|
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 {
|
|
|
|
static constexpr ConstStringRef kernels("kernels");
|
2020-10-05 01:18:49 +08:00
|
|
|
static constexpr ConstStringRef version("version");
|
2022-02-23 19:48:31 +08:00
|
|
|
static constexpr ConstStringRef globalHostAccessTable("global_host_access_table");
|
2022-03-01 01:44:06 +08:00
|
|
|
static constexpr ConstStringRef functions("functions");
|
|
|
|
|
2020-07-30 19:18:54 +08:00
|
|
|
namespace Kernel {
|
|
|
|
static constexpr ConstStringRef name("name");
|
|
|
|
static constexpr ConstStringRef executionEnv("execution_env");
|
2021-08-30 21:59:08 +08:00
|
|
|
static constexpr ConstStringRef debugEnv("debug_env");
|
2020-07-30 19:18:54 +08:00
|
|
|
static constexpr ConstStringRef payloadArguments("payload_arguments");
|
|
|
|
static constexpr ConstStringRef bindingTableIndices("binding_table_indices");
|
|
|
|
static constexpr ConstStringRef perThreadPayloadArguments("per_thread_payload_arguments");
|
2020-08-30 14:50:00 +08:00
|
|
|
static constexpr ConstStringRef perThreadMemoryBuffers("per_thread_memory_buffers");
|
2021-01-14 09:19:44 +08:00
|
|
|
static constexpr ConstStringRef experimentalProperties("experimental_properties");
|
2020-07-30 19:18:54 +08:00
|
|
|
|
|
|
|
namespace ExecutionEnv {
|
|
|
|
static constexpr ConstStringRef actualKernelStartOffset("actual_kernel_start_offset");
|
|
|
|
static constexpr ConstStringRef barrierCount("barrier_count");
|
|
|
|
static constexpr ConstStringRef disableMidThreadPreemption("disable_mid_thread_preemption");
|
|
|
|
static constexpr ConstStringRef grfCount("grf_count");
|
|
|
|
static constexpr ConstStringRef has4gbBuffers("has_4gb_buffers");
|
2021-10-25 16:52:17 +08:00
|
|
|
static constexpr ConstStringRef hasDpas("has_dpas");
|
2020-07-30 19:18:54 +08:00
|
|
|
static constexpr ConstStringRef hasFenceForImageAccess("has_fence_for_image_access");
|
|
|
|
static constexpr ConstStringRef hasGlobalAtomics("has_global_atomics");
|
|
|
|
static constexpr ConstStringRef hasMultiScratchSpaces("has_multi_scratch_spaces");
|
|
|
|
static constexpr ConstStringRef hasNoStatelessWrite("has_no_stateless_write");
|
2021-11-09 20:45:57 +08:00
|
|
|
static constexpr ConstStringRef hasStackCalls("has_stack_calls");
|
2020-07-30 19:18:54 +08:00
|
|
|
static constexpr ConstStringRef hwPreemptionMode("hw_preemption_mode");
|
2021-11-22 19:06:16 +08:00
|
|
|
static constexpr ConstStringRef inlineDataPayloadSize("inline_data_payload_size");
|
2020-07-30 19:18:54 +08:00
|
|
|
static constexpr ConstStringRef offsetToSkipPerThreadDataLoad("offset_to_skip_per_thread_data_load");
|
|
|
|
static constexpr ConstStringRef offsetToSkipSetFfidGp("offset_to_skip_set_ffid_gp");
|
|
|
|
static constexpr ConstStringRef requiredSubGroupSize("required_sub_group_size");
|
|
|
|
static constexpr ConstStringRef requiredWorkGroupSize("required_work_group_size");
|
2022-02-11 07:33:40 +08:00
|
|
|
static constexpr ConstStringRef requireDisableEUFusion("require_disable_eufusion");
|
2020-07-30 19:18:54 +08:00
|
|
|
static constexpr ConstStringRef simdSize("simd_size");
|
|
|
|
static constexpr ConstStringRef slmSize("slm_size");
|
|
|
|
static constexpr ConstStringRef subgroupIndependentForwardProgress("subgroup_independent_forward_progress");
|
|
|
|
static constexpr ConstStringRef workGroupWalkOrderDimensions("work_group_walk_order_dimensions");
|
|
|
|
} // namespace ExecutionEnv
|
|
|
|
|
2021-08-30 21:59:08 +08:00
|
|
|
namespace DebugEnv {
|
|
|
|
static constexpr ConstStringRef debugSurfaceBTI("sip_surface_bti");
|
|
|
|
} // namespace DebugEnv
|
|
|
|
|
2020-07-30 19:18:54 +08:00
|
|
|
namespace PayloadArgument {
|
|
|
|
static constexpr ConstStringRef argType("arg_type");
|
|
|
|
static constexpr ConstStringRef argIndex("arg_index");
|
|
|
|
static constexpr ConstStringRef offset("offset");
|
|
|
|
static constexpr ConstStringRef size("size");
|
|
|
|
static constexpr ConstStringRef addrmode("addrmode");
|
|
|
|
static constexpr ConstStringRef addrspace("addrspace");
|
|
|
|
static constexpr ConstStringRef accessType("access_type");
|
2021-05-11 20:50:29 +08:00
|
|
|
static constexpr ConstStringRef samplerIndex("sampler_index");
|
2021-12-15 22:32:25 +08:00
|
|
|
static constexpr ConstStringRef sourceOffset("source_offset");
|
2022-03-24 20:28:45 +08:00
|
|
|
static constexpr ConstStringRef slmArgAlignment("slm_alignment");
|
2020-07-30 19:18:54 +08:00
|
|
|
namespace ArgType {
|
|
|
|
static constexpr ConstStringRef localSize("local_size");
|
2020-08-19 19:07:34 +08:00
|
|
|
static constexpr ConstStringRef groupCount("group_count");
|
2020-07-30 19:18:54 +08:00
|
|
|
static constexpr ConstStringRef globalIdOffset("global_id_offset");
|
2020-08-19 19:07:34 +08:00
|
|
|
static constexpr ConstStringRef globalSize("global_size");
|
|
|
|
static constexpr ConstStringRef enqueuedLocalSize("enqueued_local_size");
|
2020-07-30 19:18:54 +08:00
|
|
|
static constexpr ConstStringRef privateBaseStateless("private_base_stateless");
|
|
|
|
static constexpr ConstStringRef argByvalue("arg_byvalue");
|
|
|
|
static constexpr ConstStringRef argBypointer("arg_bypointer");
|
2021-03-15 23:51:56 +08:00
|
|
|
static constexpr ConstStringRef bufferOffset("buffer_offset");
|
2021-03-17 22:31:36 +08:00
|
|
|
static constexpr ConstStringRef printfBuffer("printf_buffer");
|
2021-07-16 18:31:05 +08:00
|
|
|
static constexpr ConstStringRef workDimensions("work_dimensions");
|
2022-02-24 02:48:58 +08:00
|
|
|
static constexpr ConstStringRef implicitArgBuffer("implicit_arg_buffer");
|
2020-07-30 19:18:54 +08:00
|
|
|
} // namespace ArgType
|
|
|
|
namespace MemoryAddressingMode {
|
|
|
|
static constexpr ConstStringRef stateless("stateless");
|
|
|
|
static constexpr ConstStringRef stateful("stateful");
|
|
|
|
static constexpr ConstStringRef bindless("bindless");
|
2020-10-05 01:18:49 +08:00
|
|
|
static constexpr ConstStringRef sharedLocalMemory("slm");
|
2020-07-30 19:18:54 +08:00
|
|
|
} // namespace MemoryAddressingMode
|
|
|
|
namespace AddrSpace {
|
|
|
|
static constexpr ConstStringRef global("global");
|
|
|
|
static constexpr ConstStringRef local("local");
|
|
|
|
static constexpr ConstStringRef constant("constant");
|
|
|
|
static constexpr ConstStringRef image("image");
|
|
|
|
static constexpr ConstStringRef sampler("sampler");
|
|
|
|
} // namespace AddrSpace
|
|
|
|
namespace AccessType {
|
|
|
|
static constexpr ConstStringRef readonly("readonly");
|
|
|
|
static constexpr ConstStringRef writeonly("writeonly");
|
|
|
|
static constexpr ConstStringRef readwrite("readwrite");
|
|
|
|
} // namespace AccessType
|
|
|
|
} // namespace PayloadArgument
|
|
|
|
|
|
|
|
namespace BindingTableIndex {
|
|
|
|
static constexpr ConstStringRef btiValue("bti_value");
|
|
|
|
static constexpr ConstStringRef argIndex("arg_index");
|
|
|
|
} // namespace BindingTableIndex
|
|
|
|
|
|
|
|
namespace PerThreadPayloadArgument {
|
|
|
|
static constexpr ConstStringRef argType("arg_type");
|
|
|
|
static constexpr ConstStringRef offset("offset");
|
|
|
|
static constexpr ConstStringRef size("size");
|
|
|
|
namespace ArgType {
|
|
|
|
static constexpr ConstStringRef packedLocalIds("packed_local_ids");
|
|
|
|
static constexpr ConstStringRef localId("local_id");
|
|
|
|
} // namespace ArgType
|
|
|
|
} // namespace PerThreadPayloadArgument
|
2020-08-30 14:50:00 +08:00
|
|
|
|
|
|
|
namespace PerThreadMemoryBuffer {
|
|
|
|
static constexpr ConstStringRef allocationType("type");
|
|
|
|
static constexpr ConstStringRef memoryUsage("usage");
|
|
|
|
static constexpr ConstStringRef size("size");
|
2020-10-13 19:14:51 +08:00
|
|
|
static constexpr ConstStringRef isSimtThread("is_simt_thread");
|
2020-10-05 01:18:49 +08:00
|
|
|
static constexpr ConstStringRef slot("slot");
|
2020-08-30 14:50:00 +08:00
|
|
|
namespace AllocationType {
|
|
|
|
static constexpr ConstStringRef global("global");
|
|
|
|
static constexpr ConstStringRef scratch("scratch");
|
|
|
|
static constexpr ConstStringRef slm("slm");
|
|
|
|
} // namespace AllocationType
|
|
|
|
namespace MemoryUsage {
|
|
|
|
static constexpr ConstStringRef privateSpace("private_space");
|
|
|
|
static constexpr ConstStringRef spillFillSpace("spill_fill_space");
|
|
|
|
static constexpr ConstStringRef singleSpace("single_space");
|
|
|
|
} // namespace MemoryUsage
|
|
|
|
} // namespace PerThreadMemoryBuffer
|
2021-01-14 09:19:44 +08:00
|
|
|
namespace ExperimentalProperties {
|
|
|
|
static constexpr ConstStringRef hasNonKernelArgLoad("has_non_kernel_arg_load");
|
|
|
|
static constexpr ConstStringRef hasNonKernelArgStore("has_non_kernel_arg_store");
|
|
|
|
static constexpr ConstStringRef hasNonKernelArgAtomic("has_non_kernel_arg_atomic");
|
|
|
|
} // 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 {
|
|
|
|
static constexpr ConstStringRef deviceName("device_name");
|
|
|
|
static constexpr ConstStringRef hostName("host_name");
|
|
|
|
} // namespace GlobalHostAccessTable
|
2022-03-01 01:44:06 +08:00
|
|
|
|
|
|
|
namespace Function {
|
|
|
|
static constexpr ConstStringRef name("name");
|
|
|
|
static constexpr ConstStringRef executionEnv("execution_env");
|
|
|
|
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 {
|
|
|
|
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];
|
|
|
|
|
|
|
|
namespace Defaults {
|
|
|
|
static constexpr BarrierCountT barrierCount = 0;
|
|
|
|
static constexpr DisableMidThreadPreemptionT disableMidThreadPreemption = false;
|
|
|
|
static constexpr Has4GBBuffersT has4GBBuffers = false;
|
2021-10-25 16:52:17 +08:00
|
|
|
static constexpr HasDpasT hasDpas = false;
|
2020-07-30 19:18:54 +08:00
|
|
|
static constexpr HasFenceForImageAccessT hasFenceForImageAccess = false;
|
|
|
|
static constexpr HasGlobalAtomicsT hasGlobalAtomics = false;
|
|
|
|
static constexpr HasMultiScratchSpacesT hasMultiScratchSpaces = false;
|
2021-11-10 19:56:49 +08:00
|
|
|
static constexpr HasNonKernelArgAtomicT hasNonKernelArgAtomic = false;
|
|
|
|
static constexpr HasNonKernelArgLoadT hasNonKernelArgLoad = false;
|
|
|
|
static constexpr HasNonKernelArgStoreT hasNonKernelArgStore = false;
|
2020-07-30 19:18:54 +08:00
|
|
|
static constexpr HasNoStatelessWriteT hasNoStatelessWrite = false;
|
2021-11-09 20:45:57 +08:00
|
|
|
static constexpr HasStackCallsT hasStackCalls = false;
|
2020-07-30 19:18:54 +08:00
|
|
|
static constexpr HwPreemptionModeT hwPreemptionMode = -1;
|
2021-11-22 19:06:16 +08:00
|
|
|
static constexpr InlineDataPayloadSizeT inlineDataPayloadSize = 0;
|
2020-07-30 19:18:54 +08:00
|
|
|
static constexpr OffsetToSkipPerThreadDataLoadT offsetToSkipPerThreadDataLoad = 0;
|
|
|
|
static constexpr OffsetToSkipSetFfidGpT offsetToSkipSetFfidGp = 0;
|
|
|
|
static constexpr RequiredSubGroupSizeT requiredSubGroupSize = 0;
|
|
|
|
static constexpr RequiredWorkGroupSizeT requiredWorkGroupSize = {0, 0, 0};
|
2022-02-11 07:33:40 +08:00
|
|
|
static constexpr RequireDisableEUFusionT requireDisableEUFusion = false;
|
2020-07-30 19:18:54 +08:00
|
|
|
static constexpr SlmSizeT slmSize = 0;
|
|
|
|
static constexpr SubgroupIndependentForwardProgressT subgroupIndependentForwardProgress = false;
|
|
|
|
static constexpr WorkgroupWalkOrderDimensionsT workgroupWalkOrderDimensions = {0, 1, 2};
|
|
|
|
} // namespace Defaults
|
|
|
|
|
|
|
|
static constexpr ConstStringRef required[] = {
|
|
|
|
Tags::Kernel::ExecutionEnv::actualKernelStartOffset,
|
|
|
|
Tags::Kernel::ExecutionEnv::grfCount,
|
|
|
|
Tags::Kernel::ExecutionEnv::simdSize};
|
|
|
|
|
|
|
|
struct ExecutionEnvBaseT {
|
|
|
|
ActualKernelStartOffsetT actualKernelStartOffset = -1;
|
|
|
|
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]};
|
|
|
|
};
|
|
|
|
|
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 {
|
|
|
|
static constexpr DebugSurfaceBTIT debugSurfaceBTI = -1;
|
|
|
|
} // 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,
|
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,
|
|
|
|
ArgTypeImplicitArgBuffer
|
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,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum AddressSpace : uint8_t {
|
|
|
|
AddressSpaceUnknown = 0,
|
|
|
|
AddressSpaceGlobal = 1,
|
|
|
|
AddressSpaceLocal,
|
|
|
|
AddressSpaceConstant,
|
|
|
|
AddressSpaceImage,
|
|
|
|
AddressSpaceSampler,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum AccessType : uint8_t {
|
|
|
|
AccessTypeUnknown = 0,
|
|
|
|
AccessTypeReadonly = 1,
|
|
|
|
AccessTypeWriteonly,
|
|
|
|
AccessTypeReadwrite,
|
|
|
|
};
|
|
|
|
|
|
|
|
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 {
|
|
|
|
static constexpr ArgIndexT argIndex = -1;
|
2022-03-24 20:28:45 +08:00
|
|
|
static constexpr SlmAlignmentT slmArgAlignment = 16U;
|
2021-05-11 20:50:29 +08:00
|
|
|
static constexpr SamplerIndexT samplerIndex = -1;
|
2021-12-15 22:32:25 +08:00
|
|
|
static 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;
|
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,
|
|
|
|
AllocationTypeSlm
|
|
|
|
};
|
|
|
|
|
|
|
|
enum MemoryUsage : uint8_t {
|
|
|
|
MemoryUsageUnknown = 0,
|
|
|
|
MemoryUsagePrivateSpace,
|
|
|
|
MemoryUsageSpillFillSpace,
|
|
|
|
MemoryUsageSingleSpace
|
|
|
|
};
|
|
|
|
|
|
|
|
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 {
|
|
|
|
static constexpr IsSimtThreadT isSimtThread = false;
|
|
|
|
static constexpr Slot slot = 0U;
|
|
|
|
} // 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
|