Optimize binaries' size by adjusting linkage of constants in headers

When header is included for the first time in translation unit,
then preprocessor simply copy-pastes its content. If we define a
constant in a header file and this constant has internal linkage
then each and every translation unit, which includes this header
will have its own copy of this constant.

C++17 introduces inline variables, which are meant to allow creation
of variables in header files, which do not cause multiple instances.

The inline variable has a single instance when:
- constexpr is used without static (constexpr implicitly implies inline)
- inline is used without static
- inline const is used without static (const does not imply internal linkage
when used with inline)

Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
This commit is contained in:
Patryk Wrobel
2022-08-26 12:39:52 +00:00
committed by Compute-Runtime-Automation
parent ffe8c75291
commit c0342a0ab5
39 changed files with 426 additions and 425 deletions

View File

@@ -24,7 +24,7 @@
using namespace NEO; using namespace NEO;
const int maxHintCounter = 6; constexpr int maxHintCounter = 6;
bool containsHint(const char *providedHint, char *userData); bool containsHint(const char *providedHint, char *userData);

View File

@@ -20,7 +20,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
static constexpr auto *oclocStdoutLogName = "stdout.log"; constexpr auto *oclocStdoutLogName = "stdout.log";
struct Source { struct Source {
const uint8_t *data; const uint8_t *data;

View File

@@ -11,7 +11,7 @@
namespace NEO { namespace NEO {
namespace Queries { namespace Queries {
static constexpr ConstStringRef queryNeoRevision = "NEO_REVISION"; constexpr ConstStringRef queryNeoRevision = "NEO_REVISION";
static constexpr ConstStringRef queryOCLDriverVersion = "OCL_DRIVER_VERSION"; constexpr ConstStringRef queryOCLDriverVersion = "OCL_DRIVER_VERSION";
}; // namespace Queries }; // namespace Queries
} // namespace NEO } // namespace NEO

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018-2021 Intel Corporation * Copyright (C) 2018-2022 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -11,9 +11,9 @@
#include <limits> #include <limits>
namespace PageTableEntry { namespace PageTableEntry {
const uint32_t presentBit = 0; constexpr uint32_t presentBit = 0;
const uint32_t writableBit = 1; constexpr uint32_t writableBit = 1;
const uint32_t userSupervisorBit = 2; constexpr uint32_t userSupervisorBit = 2;
const uint32_t localMemoryBit = 11; constexpr uint32_t localMemoryBit = 11;
const uint64_t nonValidBits = std::numeric_limits<uint64_t>::max(); constexpr uint64_t nonValidBits = std::numeric_limits<uint64_t>::max();
} // namespace PageTableEntry } // namespace PageTableEntry

View File

@@ -27,14 +27,14 @@ class Device;
class SipKernel; class SipKernel;
class MemoryManager; class MemoryManager;
static constexpr ConstStringRef mediaKernelsBuildOptionsList[] = { constexpr ConstStringRef mediaKernelsBuildOptionsList[] = {
"-D cl_intel_device_side_advanced_vme_enable", "-D cl_intel_device_side_advanced_vme_enable",
"-D cl_intel_device_side_avc_vme_enable", "-D cl_intel_device_side_avc_vme_enable",
"-D cl_intel_device_side_vme_enable", "-D cl_intel_device_side_vme_enable",
"-D cl_intel_media_block_io", "-D cl_intel_media_block_io",
CompilerOptions::fastRelaxedMath}; CompilerOptions::fastRelaxedMath};
static constexpr CompilerOptions::ConstConcatenation<> mediaKernelsBuildOptions{mediaKernelsBuildOptionsList}; constexpr CompilerOptions::ConstConcatenation<> mediaKernelsBuildOptions{mediaKernelsBuildOptionsList};
struct BuiltinCode { struct BuiltinCode {
enum class ECodeType { enum class ECodeType {

View File

@@ -15,29 +15,29 @@
namespace NEO { namespace NEO {
namespace CompilerOptions { namespace CompilerOptions {
static constexpr ConstStringRef greaterThan4gbBuffersRequired = "-cl-intel-greater-than-4GB-buffer-required"; constexpr ConstStringRef greaterThan4gbBuffersRequired = "-cl-intel-greater-than-4GB-buffer-required";
static constexpr ConstStringRef hasBufferOffsetArg = "-cl-intel-has-buffer-offset-arg"; constexpr ConstStringRef hasBufferOffsetArg = "-cl-intel-has-buffer-offset-arg";
static constexpr ConstStringRef kernelDebugEnable = "-cl-kernel-debug-enable"; constexpr ConstStringRef kernelDebugEnable = "-cl-kernel-debug-enable";
static constexpr ConstStringRef arch32bit = "-m32"; constexpr ConstStringRef arch32bit = "-m32";
static constexpr ConstStringRef arch64bit = "-m64"; constexpr ConstStringRef arch64bit = "-m64";
static constexpr ConstStringRef debugKernelEnable = "-cl-kernel-debug-enable"; constexpr ConstStringRef debugKernelEnable = "-cl-kernel-debug-enable";
static constexpr ConstStringRef optDisable = "-cl-opt-disable"; constexpr ConstStringRef optDisable = "-cl-opt-disable";
static constexpr ConstStringRef argInfo = "-cl-kernel-arg-info"; constexpr ConstStringRef argInfo = "-cl-kernel-arg-info";
static constexpr ConstStringRef gtpinRera = "-cl-intel-gtpin-rera"; constexpr ConstStringRef gtpinRera = "-cl-intel-gtpin-rera";
static constexpr ConstStringRef finiteMathOnly = "-cl-finite-math-only"; constexpr ConstStringRef finiteMathOnly = "-cl-finite-math-only";
static constexpr ConstStringRef fastRelaxedMath = "-cl-fast-relaxed-math"; constexpr ConstStringRef fastRelaxedMath = "-cl-fast-relaxed-math";
static constexpr ConstStringRef preserveVec3Type = "-fpreserve-vec3-type"; constexpr ConstStringRef preserveVec3Type = "-fpreserve-vec3-type";
static constexpr ConstStringRef createLibrary = "-create-library"; constexpr ConstStringRef createLibrary = "-create-library";
static constexpr ConstStringRef generateDebugInfo = "-g"; constexpr ConstStringRef generateDebugInfo = "-g";
static constexpr ConstStringRef bindlessMode = "-cl-intel-use-bindless-mode -cl-intel-use-bindless-advanced-mode"; constexpr ConstStringRef bindlessMode = "-cl-intel-use-bindless-mode -cl-intel-use-bindless-advanced-mode";
static constexpr ConstStringRef uniformWorkgroupSize = "-cl-uniform-work-group-size"; constexpr ConstStringRef uniformWorkgroupSize = "-cl-uniform-work-group-size";
static constexpr ConstStringRef forceEmuInt32DivRem = "-cl-intel-force-emu-int32divrem"; constexpr ConstStringRef forceEmuInt32DivRem = "-cl-intel-force-emu-int32divrem";
static constexpr ConstStringRef forceEmuInt32DivRemSP = "-cl-intel-force-emu-sp-int32divrem"; constexpr ConstStringRef forceEmuInt32DivRemSP = "-cl-intel-force-emu-sp-int32divrem";
static constexpr ConstStringRef allowZebin = "-cl-intel-allow-zebin"; constexpr ConstStringRef allowZebin = "-cl-intel-allow-zebin";
static constexpr ConstStringRef enableImageSupport = "-D__IMAGE_SUPPORT__=1"; constexpr ConstStringRef enableImageSupport = "-D__IMAGE_SUPPORT__=1";
static constexpr ConstStringRef optLevel = "-ze-opt-level=O"; constexpr ConstStringRef optLevel = "-ze-opt-level=O";
static constexpr ConstStringRef excludeIrFromZebin = "-exclude-ir-from-zebin"; constexpr ConstStringRef excludeIrFromZebin = "-exclude-ir-from-zebin";
static constexpr ConstStringRef noRecompiledFromIr = "-Wno-recompiled-from-ir"; constexpr ConstStringRef noRecompiledFromIr = "-Wno-recompiled-from-ir";
constexpr size_t nullterminateSize = 1U; constexpr size_t nullterminateSize = 1U;
constexpr size_t spaceSeparatorSize = 1U; constexpr size_t spaceSeparatorSize = 1U;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021 Intel Corporation * Copyright (C) 2021-2022 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -12,7 +12,7 @@
namespace NEO { namespace NEO {
namespace CompilerWarnings { namespace CompilerWarnings {
static constexpr ConstStringRef recompiledFromIr = "warning: module got recompiled from IR because provided native binary is incompatible with underlying device and/or driver [-Wrecompiled-from-ir]"; constexpr ConstStringRef recompiledFromIr = "warning: module got recompiled from IR because provided native binary is incompatible with underlying device and/or driver [-Wrecompiled-from-ir]";
} // namespace CompilerWarnings } // namespace CompilerWarnings
} // namespace NEO } // namespace NEO

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020-2021 Intel Corporation * Copyright (C) 2020-2022 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -15,9 +15,9 @@
namespace NEO { namespace NEO {
static constexpr ConstStringRef llvmBcMagic = "BC\xc0\xde"; constexpr ConstStringRef llvmBcMagic = "BC\xc0\xde";
static constexpr ConstStringRef spirvMagic = "\x07\x23\x02\x03"; constexpr ConstStringRef spirvMagic = "\x07\x23\x02\x03";
static constexpr ConstStringRef spirvMagicInv = "\x03\x02\x23\x07"; constexpr ConstStringRef spirvMagicInv = "\x03\x02\x23\x07";
inline bool hasSameMagic(ConstStringRef expectedMagic, ArrayRef<const uint8_t> binary) { inline bool hasSameMagic(ConstStringRef expectedMagic, ArrayRef<const uint8_t> binary) {
auto binaryMagicLen = std::min(expectedMagic.size(), binary.size()); auto binaryMagicLen = std::min(expectedMagic.size(), binary.size());

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020 Intel Corporation * Copyright (C) 2020-2022 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -12,8 +12,8 @@
namespace NEO { namespace NEO {
namespace Ar { namespace Ar {
static constexpr ConstStringRef arMagic = "!<arch>\n"; constexpr ConstStringRef arMagic = "!<arch>\n";
static constexpr ConstStringRef arFileEntryTrailingMagic = "\x60\x0A"; constexpr ConstStringRef arFileEntryTrailingMagic = "\x60\x0A";
struct ArFileEntryHeader { struct ArFileEntryHeader {
char identifier[16] = {'/', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '}; char identifier[16] = {'/', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '};
@@ -27,9 +27,9 @@ struct ArFileEntryHeader {
static_assert(60U == sizeof(ArFileEntryHeader), ""); static_assert(60U == sizeof(ArFileEntryHeader), "");
namespace SpecialFileNames { namespace SpecialFileNames {
static constexpr ConstStringRef longFileNamesFile = "//"; constexpr ConstStringRef longFileNamesFile = "//";
static const char longFileNamePrefix = '/'; constexpr char longFileNamePrefix = '/';
static const char fileNameTerminator = '/'; constexpr char fileNameTerminator = '/';
} // namespace SpecialFileNames } // namespace SpecialFileNames
} // namespace Ar } // namespace Ar

View File

@@ -521,38 +521,38 @@ static_assert(sizeof(ElfRela<EI_CLASS_32>) == 0xC, "");
static_assert(sizeof(ElfRela<EI_CLASS_64>) == 0x18, ""); static_assert(sizeof(ElfRela<EI_CLASS_64>) == 0x18, "");
namespace SpecialSectionNames { namespace SpecialSectionNames {
static constexpr ConstStringRef bss = ".bss"; // uninitialized memory constexpr ConstStringRef bss = ".bss"; // uninitialized memory
static constexpr ConstStringRef comment = ".comment"; // version control information constexpr ConstStringRef comment = ".comment"; // version control information
static constexpr ConstStringRef data = ".data"; // initialized memory constexpr ConstStringRef data = ".data"; // initialized memory
static constexpr ConstStringRef data1 = ".data1"; // initialized memory constexpr ConstStringRef data1 = ".data1"; // initialized memory
static constexpr ConstStringRef debug = ".debug"; // debug symbols constexpr ConstStringRef debug = ".debug"; // debug symbols
static constexpr ConstStringRef debugInfo = ".debug_info"; // debug info constexpr ConstStringRef debugInfo = ".debug_info"; // debug info
static constexpr ConstStringRef dynamic = ".dynamic"; // dynamic linking information constexpr ConstStringRef dynamic = ".dynamic"; // dynamic linking information
static constexpr ConstStringRef dynstr = ".dynstr"; // strings for dynamic linking constexpr ConstStringRef dynstr = ".dynstr"; // strings for dynamic linking
static constexpr ConstStringRef dynsym = ".dynsym"; // dynamic linking symbol table constexpr ConstStringRef dynsym = ".dynsym"; // dynamic linking symbol table
static constexpr ConstStringRef fini = ".fini"; // executable instructions of program termination constexpr ConstStringRef fini = ".fini"; // executable instructions of program termination
static constexpr ConstStringRef finiArray = ".fini_array"; // function pointers of termination array constexpr ConstStringRef finiArray = ".fini_array"; // function pointers of termination array
static constexpr ConstStringRef got = ".got"; // global offset table constexpr ConstStringRef got = ".got"; // global offset table
static constexpr ConstStringRef hash = ".hash"; // symnol hash table constexpr ConstStringRef hash = ".hash"; // symnol hash table
static constexpr ConstStringRef init = ".init"; // executable instructions of program initializaion constexpr ConstStringRef init = ".init"; // executable instructions of program initializaion
static constexpr ConstStringRef initArray = ".init_array"; // function pointers of initialization array constexpr ConstStringRef initArray = ".init_array"; // function pointers of initialization array
static constexpr ConstStringRef interp = ".interp"; // path name of program interpreter constexpr ConstStringRef interp = ".interp"; // path name of program interpreter
static constexpr ConstStringRef line = ".line"; // line number info for symbolic debugging constexpr ConstStringRef line = ".line"; // line number info for symbolic debugging
static constexpr ConstStringRef note = ".note"; // note section constexpr ConstStringRef note = ".note"; // note section
static constexpr ConstStringRef plt = ".plt"; // procedure linkage table constexpr ConstStringRef plt = ".plt"; // procedure linkage table
static constexpr ConstStringRef preinitArray = ".preinit_array"; // function pointers of pre-initialization array constexpr ConstStringRef preinitArray = ".preinit_array"; // function pointers of pre-initialization array
static constexpr ConstStringRef relPrefix = ".rel"; // prefix of .relNAME - relocations for NAME section constexpr ConstStringRef relPrefix = ".rel"; // prefix of .relNAME - relocations for NAME section
static constexpr ConstStringRef relaPrefix = ".rela"; // prefix of .relaNAME - rela relocations for NAME section constexpr ConstStringRef relaPrefix = ".rela"; // prefix of .relaNAME - rela relocations for NAME section
static constexpr ConstStringRef rodata = ".rodata"; // read-only data constexpr ConstStringRef rodata = ".rodata"; // read-only data
static constexpr ConstStringRef rodata1 = ".rodata1"; // read-only data constexpr ConstStringRef rodata1 = ".rodata1"; // read-only data
static constexpr ConstStringRef shStrTab = ".shstrtab"; // section names (strings) constexpr ConstStringRef shStrTab = ".shstrtab"; // section names (strings)
static constexpr ConstStringRef strtab = ".strtab"; // strings constexpr ConstStringRef strtab = ".strtab"; // strings
static constexpr ConstStringRef symtab = ".symtab"; // symbol table constexpr ConstStringRef symtab = ".symtab"; // symbol table
static constexpr ConstStringRef symtabShndx = ".symtab_shndx"; // special symbol table section index array constexpr ConstStringRef symtabShndx = ".symtab_shndx"; // special symbol table section index array
static constexpr ConstStringRef tbss = ".tbss"; // uninitialized thread-local data constexpr ConstStringRef tbss = ".tbss"; // uninitialized thread-local data
static constexpr ConstStringRef tadata = ".tdata"; // initialided thread-local data constexpr ConstStringRef tadata = ".tdata"; // initialided thread-local data
static constexpr ConstStringRef tdata1 = ".tdata1"; // initialided thread-local data constexpr ConstStringRef tdata1 = ".tdata1"; // initialided thread-local data
static constexpr ConstStringRef text = ".text"; // executable instructions constexpr ConstStringRef text = ".text"; // executable instructions
} // namespace SpecialSectionNames } // namespace SpecialSectionNames
} // namespace Elf } // namespace Elf

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020-2021 Intel Corporation * Copyright (C) 2020-2022 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -49,13 +49,13 @@ static_assert(static_cast<uint32_t>(SHT_OPENCL_SOURCE) == static_cast<uint32_t>(
static_assert(static_cast<uint32_t>(SHT_OPENCL_SPIRV_SC_VALUES) == static_cast<uint32_t>(SHT_OPENCL_RESERVED_END), ""); static_assert(static_cast<uint32_t>(SHT_OPENCL_SPIRV_SC_VALUES) == static_cast<uint32_t>(SHT_OPENCL_RESERVED_END), "");
namespace SectionNamesOpenCl { namespace SectionNamesOpenCl {
static constexpr ConstStringRef buildOptions = "BuildOptions"; constexpr ConstStringRef buildOptions = "BuildOptions";
static constexpr ConstStringRef spirvObject = "SPIRV Object"; constexpr ConstStringRef spirvObject = "SPIRV Object";
static constexpr ConstStringRef llvmObject = "Intel(R) OpenCL LLVM Object"; constexpr ConstStringRef llvmObject = "Intel(R) OpenCL LLVM Object";
static constexpr ConstStringRef deviceDebug = "Intel(R) OpenCL Device Debug"; constexpr ConstStringRef deviceDebug = "Intel(R) OpenCL Device Debug";
static constexpr ConstStringRef deviceBinary = "Intel(R) OpenCL Device Binary"; constexpr ConstStringRef deviceBinary = "Intel(R) OpenCL Device Binary";
static constexpr ConstStringRef spirvSpecConstIds = "SPIRV Specialization Constants Ids"; constexpr ConstStringRef spirvSpecConstIds = "SPIRV Specialization Constants Ids";
static constexpr ConstStringRef spirvSpecConstValues = "SPIRV Specialization Constants Values"; constexpr ConstStringRef spirvSpecConstValues = "SPIRV Specialization Constants Values";
} // namespace SectionNamesOpenCl } // namespace SectionNamesOpenCl
} // namespace Elf } // namespace Elf

View File

@@ -41,27 +41,27 @@ enum RELOC_TYPE_ZEBIN : uint32_t {
}; };
namespace SectionsNamesZebin { namespace SectionsNamesZebin {
static constexpr ConstStringRef textPrefix = ".text."; constexpr ConstStringRef textPrefix = ".text.";
static constexpr ConstStringRef functions = ".text.Intel_Symbol_Table_Void_Program"; constexpr ConstStringRef functions = ".text.Intel_Symbol_Table_Void_Program";
static constexpr ConstStringRef dataConst = ".data.const"; constexpr ConstStringRef dataConst = ".data.const";
static constexpr ConstStringRef dataGlobalConst = ".data.global_const"; constexpr ConstStringRef dataGlobalConst = ".data.global_const";
static constexpr ConstStringRef dataGlobal = ".data.global"; constexpr ConstStringRef dataGlobal = ".data.global";
static constexpr ConstStringRef dataConstString = ".data.const.string"; constexpr ConstStringRef dataConstString = ".data.const.string";
static constexpr ConstStringRef symtab = ".symtab"; constexpr ConstStringRef symtab = ".symtab";
static constexpr ConstStringRef relTablePrefix = ".rel."; constexpr ConstStringRef relTablePrefix = ".rel.";
static constexpr ConstStringRef spv = ".spv"; constexpr ConstStringRef spv = ".spv";
static constexpr ConstStringRef debugPrefix = ".debug_"; constexpr ConstStringRef debugPrefix = ".debug_";
static constexpr ConstStringRef debugInfo = ".debug_info"; constexpr ConstStringRef debugInfo = ".debug_info";
static constexpr ConstStringRef debugAbbrev = ".debug_abbrev"; constexpr ConstStringRef debugAbbrev = ".debug_abbrev";
static constexpr ConstStringRef zeInfo = ".ze_info"; constexpr ConstStringRef zeInfo = ".ze_info";
static constexpr ConstStringRef gtpinInfo = ".gtpin_info"; constexpr ConstStringRef gtpinInfo = ".gtpin_info";
static constexpr ConstStringRef noteIntelGT = ".note.intelgt.compat"; constexpr ConstStringRef noteIntelGT = ".note.intelgt.compat";
static constexpr ConstStringRef buildOptions = ".misc.buildOptions"; constexpr ConstStringRef buildOptions = ".misc.buildOptions";
static constexpr ConstStringRef vIsaAsmPrefix = ".visaasm."; constexpr ConstStringRef vIsaAsmPrefix = ".visaasm.";
static constexpr ConstStringRef externalFunctions = "Intel_Symbol_Table_Void_Program"; constexpr ConstStringRef externalFunctions = "Intel_Symbol_Table_Void_Program";
} // namespace SectionsNamesZebin } // namespace SectionsNamesZebin
static constexpr ConstStringRef IntelGtNoteOwnerName = "IntelGT"; constexpr ConstStringRef IntelGtNoteOwnerName = "IntelGT";
enum IntelGTSectionType : uint32_t { enum IntelGTSectionType : uint32_t {
ProductFamily = 1, ProductFamily = 1,
GfxCore = 2, GfxCore = 2,
@@ -114,209 +114,209 @@ static_assert(sizeof(ZebinTargetFlags) == sizeof(uint32_t), "");
namespace ZebinKernelMetadata { namespace ZebinKernelMetadata {
namespace Tags { namespace Tags {
static constexpr ConstStringRef kernels("kernels"); constexpr ConstStringRef kernels("kernels");
static constexpr ConstStringRef version("version"); constexpr ConstStringRef version("version");
static constexpr ConstStringRef globalHostAccessTable("global_host_access_table"); constexpr ConstStringRef globalHostAccessTable("global_host_access_table");
static constexpr ConstStringRef functions("functions"); constexpr ConstStringRef functions("functions");
namespace Kernel { namespace Kernel {
static constexpr ConstStringRef name("name"); constexpr ConstStringRef name("name");
static constexpr ConstStringRef executionEnv("execution_env"); constexpr ConstStringRef executionEnv("execution_env");
static constexpr ConstStringRef debugEnv("debug_env"); constexpr ConstStringRef debugEnv("debug_env");
static constexpr ConstStringRef payloadArguments("payload_arguments"); constexpr ConstStringRef payloadArguments("payload_arguments");
static constexpr ConstStringRef bindingTableIndices("binding_table_indices"); constexpr ConstStringRef bindingTableIndices("binding_table_indices");
static constexpr ConstStringRef perThreadPayloadArguments("per_thread_payload_arguments"); constexpr ConstStringRef perThreadPayloadArguments("per_thread_payload_arguments");
static constexpr ConstStringRef perThreadMemoryBuffers("per_thread_memory_buffers"); constexpr ConstStringRef perThreadMemoryBuffers("per_thread_memory_buffers");
static constexpr ConstStringRef experimentalProperties("experimental_properties"); constexpr ConstStringRef experimentalProperties("experimental_properties");
namespace ExecutionEnv { namespace ExecutionEnv {
static constexpr ConstStringRef barrierCount("barrier_count"); constexpr ConstStringRef barrierCount("barrier_count");
static constexpr ConstStringRef disableMidThreadPreemption("disable_mid_thread_preemption"); constexpr ConstStringRef disableMidThreadPreemption("disable_mid_thread_preemption");
static constexpr ConstStringRef grfCount("grf_count"); constexpr ConstStringRef grfCount("grf_count");
static constexpr ConstStringRef has4gbBuffers("has_4gb_buffers"); constexpr ConstStringRef has4gbBuffers("has_4gb_buffers");
static constexpr ConstStringRef hasDpas("has_dpas"); constexpr ConstStringRef hasDpas("has_dpas");
static constexpr ConstStringRef hasFenceForImageAccess("has_fence_for_image_access"); constexpr ConstStringRef hasFenceForImageAccess("has_fence_for_image_access");
static constexpr ConstStringRef hasGlobalAtomics("has_global_atomics"); constexpr ConstStringRef hasGlobalAtomics("has_global_atomics");
static constexpr ConstStringRef hasMultiScratchSpaces("has_multi_scratch_spaces"); constexpr ConstStringRef hasMultiScratchSpaces("has_multi_scratch_spaces");
static constexpr ConstStringRef hasNoStatelessWrite("has_no_stateless_write"); constexpr ConstStringRef hasNoStatelessWrite("has_no_stateless_write");
static constexpr ConstStringRef hasStackCalls("has_stack_calls"); constexpr ConstStringRef hasStackCalls("has_stack_calls");
static constexpr ConstStringRef hwPreemptionMode("hw_preemption_mode"); constexpr ConstStringRef hwPreemptionMode("hw_preemption_mode");
static constexpr ConstStringRef inlineDataPayloadSize("inline_data_payload_size"); constexpr ConstStringRef inlineDataPayloadSize("inline_data_payload_size");
static constexpr ConstStringRef offsetToSkipPerThreadDataLoad("offset_to_skip_per_thread_data_load"); constexpr ConstStringRef offsetToSkipPerThreadDataLoad("offset_to_skip_per_thread_data_load");
static constexpr ConstStringRef offsetToSkipSetFfidGp("offset_to_skip_set_ffid_gp"); constexpr ConstStringRef offsetToSkipSetFfidGp("offset_to_skip_set_ffid_gp");
static constexpr ConstStringRef requiredSubGroupSize("required_sub_group_size"); constexpr ConstStringRef requiredSubGroupSize("required_sub_group_size");
static constexpr ConstStringRef requiredWorkGroupSize("required_work_group_size"); constexpr ConstStringRef requiredWorkGroupSize("required_work_group_size");
static constexpr ConstStringRef requireDisableEUFusion("require_disable_eufusion"); constexpr ConstStringRef requireDisableEUFusion("require_disable_eufusion");
static constexpr ConstStringRef simdSize("simd_size"); constexpr ConstStringRef simdSize("simd_size");
static constexpr ConstStringRef slmSize("slm_size"); constexpr ConstStringRef slmSize("slm_size");
static constexpr ConstStringRef subgroupIndependentForwardProgress("subgroup_independent_forward_progress"); constexpr ConstStringRef subgroupIndependentForwardProgress("subgroup_independent_forward_progress");
static constexpr ConstStringRef workGroupWalkOrderDimensions("work_group_walk_order_dimensions"); constexpr ConstStringRef workGroupWalkOrderDimensions("work_group_walk_order_dimensions");
static constexpr ConstStringRef threadSchedulingMode("thread_scheduling_mode"); constexpr ConstStringRef threadSchedulingMode("thread_scheduling_mode");
namespace ThreadSchedulingMode { namespace ThreadSchedulingMode {
static constexpr ConstStringRef ageBased("age_based"); constexpr ConstStringRef ageBased("age_based");
static constexpr ConstStringRef roundRobin("round_robin"); constexpr ConstStringRef roundRobin("round_robin");
static constexpr ConstStringRef roundRobinStall("round_robin_stall"); constexpr ConstStringRef roundRobinStall("round_robin_stall");
} // namespace ThreadSchedulingMode } // namespace ThreadSchedulingMode
} // namespace ExecutionEnv } // namespace ExecutionEnv
namespace DebugEnv { namespace DebugEnv {
static constexpr ConstStringRef debugSurfaceBTI("sip_surface_bti"); constexpr ConstStringRef debugSurfaceBTI("sip_surface_bti");
} // namespace DebugEnv } // namespace DebugEnv
namespace PayloadArgument { namespace PayloadArgument {
static constexpr ConstStringRef argType("arg_type"); constexpr ConstStringRef argType("arg_type");
static constexpr ConstStringRef argIndex("arg_index"); constexpr ConstStringRef argIndex("arg_index");
static constexpr ConstStringRef offset("offset"); constexpr ConstStringRef offset("offset");
static constexpr ConstStringRef size("size"); constexpr ConstStringRef size("size");
static constexpr ConstStringRef addrmode("addrmode"); constexpr ConstStringRef addrmode("addrmode");
static constexpr ConstStringRef addrspace("addrspace"); constexpr ConstStringRef addrspace("addrspace");
static constexpr ConstStringRef accessType("access_type"); constexpr ConstStringRef accessType("access_type");
static constexpr ConstStringRef samplerIndex("sampler_index"); constexpr ConstStringRef samplerIndex("sampler_index");
static constexpr ConstStringRef sourceOffset("source_offset"); constexpr ConstStringRef sourceOffset("source_offset");
static constexpr ConstStringRef slmArgAlignment("slm_alignment"); constexpr ConstStringRef slmArgAlignment("slm_alignment");
static constexpr ConstStringRef imageType("image_type"); constexpr ConstStringRef imageType("image_type");
static constexpr ConstStringRef imageTransformable("image_transformable"); constexpr ConstStringRef imageTransformable("image_transformable");
static constexpr ConstStringRef samplerType("sampler_type"); constexpr ConstStringRef samplerType("sampler_type");
namespace ArgType { namespace ArgType {
static constexpr ConstStringRef localSize("local_size"); constexpr ConstStringRef localSize("local_size");
static constexpr ConstStringRef groupCount("group_count"); constexpr ConstStringRef groupCount("group_count");
static constexpr ConstStringRef globalIdOffset("global_id_offset"); constexpr ConstStringRef globalIdOffset("global_id_offset");
static constexpr ConstStringRef globalSize("global_size"); constexpr ConstStringRef globalSize("global_size");
static constexpr ConstStringRef enqueuedLocalSize("enqueued_local_size"); constexpr ConstStringRef enqueuedLocalSize("enqueued_local_size");
static constexpr ConstStringRef privateBaseStateless("private_base_stateless"); constexpr ConstStringRef privateBaseStateless("private_base_stateless");
static constexpr ConstStringRef argByvalue("arg_byvalue"); constexpr ConstStringRef argByvalue("arg_byvalue");
static constexpr ConstStringRef argBypointer("arg_bypointer"); constexpr ConstStringRef argBypointer("arg_bypointer");
static constexpr ConstStringRef bufferAddress("buffer_address"); constexpr ConstStringRef bufferAddress("buffer_address");
static constexpr ConstStringRef bufferOffset("buffer_offset"); constexpr ConstStringRef bufferOffset("buffer_offset");
static constexpr ConstStringRef printfBuffer("printf_buffer"); constexpr ConstStringRef printfBuffer("printf_buffer");
static constexpr ConstStringRef workDimensions("work_dimensions"); constexpr ConstStringRef workDimensions("work_dimensions");
static constexpr ConstStringRef implicitArgBuffer("implicit_arg_buffer"); constexpr ConstStringRef implicitArgBuffer("implicit_arg_buffer");
namespace Image { namespace Image {
static constexpr ConstStringRef width("image_width"); constexpr ConstStringRef width("image_width");
static constexpr ConstStringRef height("image_height"); constexpr ConstStringRef height("image_height");
static constexpr ConstStringRef depth("image_depth"); constexpr ConstStringRef depth("image_depth");
static constexpr ConstStringRef channelDataType("image_channel_data_type"); constexpr ConstStringRef channelDataType("image_channel_data_type");
static constexpr ConstStringRef channelOrder("image_channel_order"); constexpr ConstStringRef channelOrder("image_channel_order");
static constexpr ConstStringRef arraySize("image_array_size"); constexpr ConstStringRef arraySize("image_array_size");
static constexpr ConstStringRef numSamples("image_num_samples"); constexpr ConstStringRef numSamples("image_num_samples");
static constexpr ConstStringRef numMipLevels("image_num_mip_levels"); constexpr ConstStringRef numMipLevels("image_num_mip_levels");
static constexpr ConstStringRef flatBaseOffset("flat_image_baseoffset"); constexpr ConstStringRef flatBaseOffset("flat_image_baseoffset");
static constexpr ConstStringRef flatWidth("flat_image_width"); constexpr ConstStringRef flatWidth("flat_image_width");
static constexpr ConstStringRef flatHeight("flat_image_height"); constexpr ConstStringRef flatHeight("flat_image_height");
static constexpr ConstStringRef flatPitch("flat_image_pitch"); constexpr ConstStringRef flatPitch("flat_image_pitch");
} // namespace Image } // namespace Image
namespace Sampler { namespace Sampler {
static constexpr ConstStringRef snapWa("sampler_snap_wa"); constexpr ConstStringRef snapWa("sampler_snap_wa");
static constexpr ConstStringRef normCoords("sampler_normalized"); constexpr ConstStringRef normCoords("sampler_normalized");
static constexpr ConstStringRef addrMode("sampler_address"); constexpr ConstStringRef addrMode("sampler_address");
namespace Vme { namespace Vme {
static constexpr ConstStringRef blockType("vme_mb_block_type"); constexpr ConstStringRef blockType("vme_mb_block_type");
static constexpr ConstStringRef subpixelMode("vme_subpixel_mode"); constexpr ConstStringRef subpixelMode("vme_subpixel_mode");
static constexpr ConstStringRef sadAdjustMode("vme_sad_adjust_mode"); constexpr ConstStringRef sadAdjustMode("vme_sad_adjust_mode");
static constexpr ConstStringRef searchPathType("vme_search_path_type"); constexpr ConstStringRef searchPathType("vme_search_path_type");
} // namespace Vme } // namespace Vme
} // namespace Sampler } // namespace Sampler
} // namespace ArgType } // namespace ArgType
namespace ImageType { namespace ImageType {
static constexpr ConstStringRef imageTypeBuffer("image_buffer"); constexpr ConstStringRef imageTypeBuffer("image_buffer");
static constexpr ConstStringRef imageType1D("image_1d"); constexpr ConstStringRef imageType1D("image_1d");
static constexpr ConstStringRef imageType1DArray("image_1d_array"); constexpr ConstStringRef imageType1DArray("image_1d_array");
static constexpr ConstStringRef imageType2D("image_2d"); constexpr ConstStringRef imageType2D("image_2d");
static constexpr ConstStringRef imageType2DArray("image_2d_array"); constexpr ConstStringRef imageType2DArray("image_2d_array");
static constexpr ConstStringRef imageType3D("image_3d"); constexpr ConstStringRef imageType3D("image_3d");
static constexpr ConstStringRef imageTypeCube("image_cube_array"); constexpr ConstStringRef imageTypeCube("image_cube_array");
static constexpr ConstStringRef imageTypeCubeArray("image_buffer"); constexpr ConstStringRef imageTypeCubeArray("image_buffer");
static constexpr ConstStringRef imageType2DDepth("image_2d_depth"); constexpr ConstStringRef imageType2DDepth("image_2d_depth");
static constexpr ConstStringRef imageType2DArrayDepth("image_2d_array_depth"); constexpr ConstStringRef imageType2DArrayDepth("image_2d_array_depth");
static constexpr ConstStringRef imageType2DMSAA("image_2d_msaa"); constexpr ConstStringRef imageType2DMSAA("image_2d_msaa");
static constexpr ConstStringRef imageType2DMSAADepth("image_2d_msaa_depth"); constexpr ConstStringRef imageType2DMSAADepth("image_2d_msaa_depth");
static constexpr ConstStringRef imageType2DArrayMSAA("image_2d_array_msaa"); constexpr ConstStringRef imageType2DArrayMSAA("image_2d_array_msaa");
static constexpr ConstStringRef imageType2DArrayMSAADepth("image_2d_array_msaa_depth"); constexpr ConstStringRef imageType2DArrayMSAADepth("image_2d_array_msaa_depth");
static constexpr ConstStringRef imageType2DMedia("image_2d_media"); constexpr ConstStringRef imageType2DMedia("image_2d_media");
static constexpr ConstStringRef imageType2DMediaBlock("image_2d_media_block"); constexpr ConstStringRef imageType2DMediaBlock("image_2d_media_block");
} // namespace ImageType } // namespace ImageType
namespace SamplerType { namespace SamplerType {
static constexpr ConstStringRef samplerTypeTexture("texture"); constexpr ConstStringRef samplerTypeTexture("texture");
static constexpr ConstStringRef samplerType8x8("sample_8x8"); constexpr ConstStringRef samplerType8x8("sample_8x8");
static constexpr ConstStringRef samplerType2DConsolve8x8("sample_8x8_2dconvolve"); constexpr ConstStringRef samplerType2DConsolve8x8("sample_8x8_2dconvolve");
static constexpr ConstStringRef samplerTypeErode8x8("sample_8x8_erode"); constexpr ConstStringRef samplerTypeErode8x8("sample_8x8_erode");
static constexpr ConstStringRef samplerTypeDilate8x8("sample_8x8_dilate"); constexpr ConstStringRef samplerTypeDilate8x8("sample_8x8_dilate");
static constexpr ConstStringRef samplerTypeMinMaxFilter8x8("sample_8x8_minmaxfilter"); constexpr ConstStringRef samplerTypeMinMaxFilter8x8("sample_8x8_minmaxfilter");
static constexpr ConstStringRef samplerTypeCentroid8x8("sample_8x8_centroid"); constexpr ConstStringRef samplerTypeCentroid8x8("sample_8x8_centroid");
static constexpr ConstStringRef samplerTypeBoolCentroid8x8("sample_8x8_bool_centroid"); constexpr ConstStringRef samplerTypeBoolCentroid8x8("sample_8x8_bool_centroid");
static constexpr ConstStringRef samplerTypeBoolSum8x8("sample_8x8_bool_sum"); constexpr ConstStringRef samplerTypeBoolSum8x8("sample_8x8_bool_sum");
static constexpr ConstStringRef samplerTypeVD("vd"); constexpr ConstStringRef samplerTypeVD("vd");
static constexpr ConstStringRef samplerTypeVE("ve"); constexpr ConstStringRef samplerTypeVE("ve");
static constexpr ConstStringRef samplerTypeVME("vme"); constexpr ConstStringRef samplerTypeVME("vme");
} // namespace SamplerType } // namespace SamplerType
namespace MemoryAddressingMode { namespace MemoryAddressingMode {
static constexpr ConstStringRef stateless("stateless"); constexpr ConstStringRef stateless("stateless");
static constexpr ConstStringRef stateful("stateful"); constexpr ConstStringRef stateful("stateful");
static constexpr ConstStringRef bindless("bindless"); constexpr ConstStringRef bindless("bindless");
static constexpr ConstStringRef sharedLocalMemory("slm"); constexpr ConstStringRef sharedLocalMemory("slm");
} // namespace MemoryAddressingMode } // namespace MemoryAddressingMode
namespace AddrSpace { namespace AddrSpace {
static constexpr ConstStringRef global("global"); constexpr ConstStringRef global("global");
static constexpr ConstStringRef local("local"); constexpr ConstStringRef local("local");
static constexpr ConstStringRef constant("constant"); constexpr ConstStringRef constant("constant");
static constexpr ConstStringRef image("image"); constexpr ConstStringRef image("image");
static constexpr ConstStringRef sampler("sampler"); constexpr ConstStringRef sampler("sampler");
} // namespace AddrSpace } // namespace AddrSpace
namespace AccessType { namespace AccessType {
static constexpr ConstStringRef readonly("readonly"); constexpr ConstStringRef readonly("readonly");
static constexpr ConstStringRef writeonly("writeonly"); constexpr ConstStringRef writeonly("writeonly");
static constexpr ConstStringRef readwrite("readwrite"); constexpr ConstStringRef readwrite("readwrite");
} // namespace AccessType } // namespace AccessType
} // namespace PayloadArgument } // namespace PayloadArgument
namespace BindingTableIndex { namespace BindingTableIndex {
static constexpr ConstStringRef btiValue("bti_value"); constexpr ConstStringRef btiValue("bti_value");
static constexpr ConstStringRef argIndex("arg_index"); constexpr ConstStringRef argIndex("arg_index");
} // namespace BindingTableIndex } // namespace BindingTableIndex
namespace PerThreadPayloadArgument { namespace PerThreadPayloadArgument {
static constexpr ConstStringRef argType("arg_type"); constexpr ConstStringRef argType("arg_type");
static constexpr ConstStringRef offset("offset"); constexpr ConstStringRef offset("offset");
static constexpr ConstStringRef size("size"); constexpr ConstStringRef size("size");
namespace ArgType { namespace ArgType {
static constexpr ConstStringRef packedLocalIds("packed_local_ids"); constexpr ConstStringRef packedLocalIds("packed_local_ids");
static constexpr ConstStringRef localId("local_id"); constexpr ConstStringRef localId("local_id");
} // namespace ArgType } // namespace ArgType
} // namespace PerThreadPayloadArgument } // namespace PerThreadPayloadArgument
namespace PerThreadMemoryBuffer { namespace PerThreadMemoryBuffer {
static constexpr ConstStringRef allocationType("type"); constexpr ConstStringRef allocationType("type");
static constexpr ConstStringRef memoryUsage("usage"); constexpr ConstStringRef memoryUsage("usage");
static constexpr ConstStringRef size("size"); constexpr ConstStringRef size("size");
static constexpr ConstStringRef isSimtThread("is_simt_thread"); constexpr ConstStringRef isSimtThread("is_simt_thread");
static constexpr ConstStringRef slot("slot"); constexpr ConstStringRef slot("slot");
namespace AllocationType { namespace AllocationType {
static constexpr ConstStringRef global("global"); constexpr ConstStringRef global("global");
static constexpr ConstStringRef scratch("scratch"); constexpr ConstStringRef scratch("scratch");
static constexpr ConstStringRef slm("slm"); constexpr ConstStringRef slm("slm");
} // namespace AllocationType } // namespace AllocationType
namespace MemoryUsage { namespace MemoryUsage {
static constexpr ConstStringRef privateSpace("private_space"); constexpr ConstStringRef privateSpace("private_space");
static constexpr ConstStringRef spillFillSpace("spill_fill_space"); constexpr ConstStringRef spillFillSpace("spill_fill_space");
static constexpr ConstStringRef singleSpace("single_space"); constexpr ConstStringRef singleSpace("single_space");
} // namespace MemoryUsage } // namespace MemoryUsage
} // namespace PerThreadMemoryBuffer } // namespace PerThreadMemoryBuffer
namespace ExperimentalProperties { namespace ExperimentalProperties {
static constexpr ConstStringRef hasNonKernelArgLoad("has_non_kernel_arg_load"); constexpr ConstStringRef hasNonKernelArgLoad("has_non_kernel_arg_load");
static constexpr ConstStringRef hasNonKernelArgStore("has_non_kernel_arg_store"); constexpr ConstStringRef hasNonKernelArgStore("has_non_kernel_arg_store");
static constexpr ConstStringRef hasNonKernelArgAtomic("has_non_kernel_arg_atomic"); constexpr ConstStringRef hasNonKernelArgAtomic("has_non_kernel_arg_atomic");
} // namespace ExperimentalProperties } // namespace ExperimentalProperties
} // namespace Kernel } // namespace Kernel
namespace GlobalHostAccessTable { namespace GlobalHostAccessTable {
static constexpr ConstStringRef deviceName("device_name"); constexpr ConstStringRef deviceName("device_name");
static constexpr ConstStringRef hostName("host_name"); constexpr ConstStringRef hostName("host_name");
} // namespace GlobalHostAccessTable } // namespace GlobalHostAccessTable
namespace Function { namespace Function {
static constexpr ConstStringRef name("name"); constexpr ConstStringRef name("name");
static constexpr ConstStringRef executionEnv("execution_env"); constexpr ConstStringRef executionEnv("execution_env");
using namespace Kernel::ExecutionEnv; using namespace Kernel::ExecutionEnv;
} // namespace Function } // namespace Function
@@ -367,32 +367,32 @@ using WorkgroupWalkOrderDimensionsT = int32_t[3];
using ThreadSchedulingModeT = ThreadSchedulingMode; using ThreadSchedulingModeT = ThreadSchedulingMode;
namespace Defaults { namespace Defaults {
static constexpr BarrierCountT barrierCount = 0; constexpr BarrierCountT barrierCount = 0;
static constexpr DisableMidThreadPreemptionT disableMidThreadPreemption = false; constexpr DisableMidThreadPreemptionT disableMidThreadPreemption = false;
static constexpr Has4GBBuffersT has4GBBuffers = false; constexpr Has4GBBuffersT has4GBBuffers = false;
static constexpr HasDpasT hasDpas = false; constexpr HasDpasT hasDpas = false;
static constexpr HasFenceForImageAccessT hasFenceForImageAccess = false; constexpr HasFenceForImageAccessT hasFenceForImageAccess = false;
static constexpr HasGlobalAtomicsT hasGlobalAtomics = false; constexpr HasGlobalAtomicsT hasGlobalAtomics = false;
static constexpr HasMultiScratchSpacesT hasMultiScratchSpaces = false; constexpr HasMultiScratchSpacesT hasMultiScratchSpaces = false;
static constexpr HasNonKernelArgAtomicT hasNonKernelArgAtomic = false; constexpr HasNonKernelArgAtomicT hasNonKernelArgAtomic = false;
static constexpr HasNonKernelArgLoadT hasNonKernelArgLoad = false; constexpr HasNonKernelArgLoadT hasNonKernelArgLoad = false;
static constexpr HasNonKernelArgStoreT hasNonKernelArgStore = false; constexpr HasNonKernelArgStoreT hasNonKernelArgStore = false;
static constexpr HasNoStatelessWriteT hasNoStatelessWrite = false; constexpr HasNoStatelessWriteT hasNoStatelessWrite = false;
static constexpr HasStackCallsT hasStackCalls = false; constexpr HasStackCallsT hasStackCalls = false;
static constexpr HwPreemptionModeT hwPreemptionMode = -1; constexpr HwPreemptionModeT hwPreemptionMode = -1;
static constexpr InlineDataPayloadSizeT inlineDataPayloadSize = 0; constexpr InlineDataPayloadSizeT inlineDataPayloadSize = 0;
static constexpr OffsetToSkipPerThreadDataLoadT offsetToSkipPerThreadDataLoad = 0; constexpr OffsetToSkipPerThreadDataLoadT offsetToSkipPerThreadDataLoad = 0;
static constexpr OffsetToSkipSetFfidGpT offsetToSkipSetFfidGp = 0; constexpr OffsetToSkipSetFfidGpT offsetToSkipSetFfidGp = 0;
static constexpr RequiredSubGroupSizeT requiredSubGroupSize = 0; constexpr RequiredSubGroupSizeT requiredSubGroupSize = 0;
static constexpr RequiredWorkGroupSizeT requiredWorkGroupSize = {0, 0, 0}; constexpr RequiredWorkGroupSizeT requiredWorkGroupSize = {0, 0, 0};
static constexpr RequireDisableEUFusionT requireDisableEUFusion = false; constexpr RequireDisableEUFusionT requireDisableEUFusion = false;
static constexpr SlmSizeT slmSize = 0; constexpr SlmSizeT slmSize = 0;
static constexpr SubgroupIndependentForwardProgressT subgroupIndependentForwardProgress = false; constexpr SubgroupIndependentForwardProgressT subgroupIndependentForwardProgress = false;
static constexpr WorkgroupWalkOrderDimensionsT workgroupWalkOrderDimensions = {0, 1, 2}; constexpr WorkgroupWalkOrderDimensionsT workgroupWalkOrderDimensions = {0, 1, 2};
static constexpr ThreadSchedulingModeT threadSchedulingMode = ThreadSchedulingModeUnknown; constexpr ThreadSchedulingModeT threadSchedulingMode = ThreadSchedulingModeUnknown;
} // namespace Defaults } // namespace Defaults
static constexpr ConstStringRef required[] = { constexpr ConstStringRef required[] = {
Tags::Kernel::ExecutionEnv::grfCount, Tags::Kernel::ExecutionEnv::grfCount,
Tags::Kernel::ExecutionEnv::simdSize}; Tags::Kernel::ExecutionEnv::simdSize};
@@ -433,7 +433,7 @@ namespace DebugEnv {
using DebugSurfaceBTIT = int32_t; using DebugSurfaceBTIT = int32_t;
namespace Defaults { namespace Defaults {
static constexpr DebugSurfaceBTIT debugSurfaceBTI = -1; constexpr DebugSurfaceBTIT debugSurfaceBTI = -1;
} // namespace Defaults } // namespace Defaults
struct DebugEnvBaseT { struct DebugEnvBaseT {
@@ -576,10 +576,10 @@ using SlmAlignmentT = uint8_t;
using SamplerIndexT = int32_t; using SamplerIndexT = int32_t;
namespace Defaults { namespace Defaults {
static constexpr ArgIndexT argIndex = -1; constexpr ArgIndexT argIndex = -1;
static constexpr SlmAlignmentT slmArgAlignment = 16U; constexpr SlmAlignmentT slmArgAlignment = 16U;
static constexpr SamplerIndexT samplerIndex = -1; constexpr SamplerIndexT samplerIndex = -1;
static constexpr SourceOffseT sourceOffset = -1; constexpr SourceOffseT sourceOffset = -1;
} // namespace Defaults } // namespace Defaults
struct PayloadArgumentBaseT { struct PayloadArgumentBaseT {
@@ -633,8 +633,8 @@ using IsSimtThreadT = bool;
using Slot = int32_t; using Slot = int32_t;
namespace Defaults { namespace Defaults {
static constexpr IsSimtThreadT isSimtThread = false; constexpr IsSimtThreadT isSimtThread = false;
static constexpr Slot slot = 0U; constexpr Slot slot = 0U;
} // namespace Defaults } // namespace Defaults
struct PerThreadMemoryBufferBaseT { struct PerThreadMemoryBufferBaseT {

View File

@@ -21,52 +21,52 @@ using namespace Tags::Kernel::PayloadArgument::ArgType::Sampler;
using namespace Tags::Kernel::PayloadArgument::ArgType::Sampler::Vme; using namespace Tags::Kernel::PayloadArgument::ArgType::Sampler::Vme;
using ArgType = Types::Kernel::ArgType; using ArgType = Types::Kernel::ArgType;
static constexpr ConstStringRef name = "argument type"; constexpr ConstStringRef name = "argument type";
static constexpr LookupArray<ConstStringRef, ArgType, 34> lookup({{{packedLocalIds, ArgType::ArgTypePackedLocalIds}, constexpr LookupArray<ConstStringRef, ArgType, 34> lookup({{{packedLocalIds, ArgType::ArgTypePackedLocalIds},
{localId, ArgType::ArgTypeLocalId}, {localId, ArgType::ArgTypeLocalId},
{localSize, ArgType::ArgTypeLocalSize}, {localSize, ArgType::ArgTypeLocalSize},
{groupCount, ArgType::ArgTypeGroupCount}, {groupCount, ArgType::ArgTypeGroupCount},
{globalSize, ArgType::ArgTypeGlobalSize}, {globalSize, ArgType::ArgTypeGlobalSize},
{enqueuedLocalSize, ArgType::ArgTypeEnqueuedLocalSize}, {enqueuedLocalSize, ArgType::ArgTypeEnqueuedLocalSize},
{globalIdOffset, ArgType::ArgTypeGlobalIdOffset}, {globalIdOffset, ArgType::ArgTypeGlobalIdOffset},
{privateBaseStateless, ArgType::ArgTypePrivateBaseStateless}, {privateBaseStateless, ArgType::ArgTypePrivateBaseStateless},
{argByvalue, ArgType::ArgTypeArgByvalue}, {argByvalue, ArgType::ArgTypeArgByvalue},
{argBypointer, ArgType::ArgTypeArgBypointer}, {argBypointer, ArgType::ArgTypeArgBypointer},
{bufferAddress, ArgType::ArgTypeBufferAddress}, {bufferAddress, ArgType::ArgTypeBufferAddress},
{bufferOffset, ArgType::ArgTypeBufferOffset}, {bufferOffset, ArgType::ArgTypeBufferOffset},
{printfBuffer, ArgType::ArgTypePrintfBuffer}, {printfBuffer, ArgType::ArgTypePrintfBuffer},
{workDimensions, ArgType::ArgTypeWorkDimensions}, {workDimensions, ArgType::ArgTypeWorkDimensions},
{implicitArgBuffer, ArgType::ArgTypeImplicitArgBuffer}, {implicitArgBuffer, ArgType::ArgTypeImplicitArgBuffer},
{width, ArgType::ArgTypeImageWidth}, {width, ArgType::ArgTypeImageWidth},
{height, ArgType::ArgTypeImageHeight}, {height, ArgType::ArgTypeImageHeight},
{depth, ArgType::ArgTypeImageDepth}, {depth, ArgType::ArgTypeImageDepth},
{channelDataType, ArgType::ArgTypeImageChannelDataType}, {channelDataType, ArgType::ArgTypeImageChannelDataType},
{channelOrder, ArgType::ArgTypeImageChannelOrder}, {channelOrder, ArgType::ArgTypeImageChannelOrder},
{arraySize, ArgType::ArgTypeImageArraySize}, {arraySize, ArgType::ArgTypeImageArraySize},
{numSamples, ArgType::ArgTypeImageNumSamples}, {numSamples, ArgType::ArgTypeImageNumSamples},
{numMipLevels, ArgType::ArgTypeImageMipLevels}, {numMipLevels, ArgType::ArgTypeImageMipLevels},
{flatBaseOffset, ArgType::ArgTypeImageFlatBaseOffset}, {flatBaseOffset, ArgType::ArgTypeImageFlatBaseOffset},
{flatWidth, ArgType::ArgTypeImageFlatWidth}, {flatWidth, ArgType::ArgTypeImageFlatWidth},
{flatHeight, ArgType::ArgTypeImageFlatHeight}, {flatHeight, ArgType::ArgTypeImageFlatHeight},
{flatPitch, ArgType::ArgTypeImageFlatPitch}, {flatPitch, ArgType::ArgTypeImageFlatPitch},
{snapWa, ArgType::ArgTypeSamplerSnapWa}, {snapWa, ArgType::ArgTypeSamplerSnapWa},
{normCoords, ArgType::ArgTypeSamplerNormCoords}, {normCoords, ArgType::ArgTypeSamplerNormCoords},
{addrMode, ArgType::ArgTypeSamplerAddrMode}, {addrMode, ArgType::ArgTypeSamplerAddrMode},
{blockType, ArgType::ArgTypeVmeMbBlockType}, {blockType, ArgType::ArgTypeVmeMbBlockType},
{subpixelMode, ArgType::ArgTypeVmeSubpixelMode}, {subpixelMode, ArgType::ArgTypeVmeSubpixelMode},
{sadAdjustMode, ArgType::ArgTypeVmeSadAdjustMode}, {sadAdjustMode, ArgType::ArgTypeVmeSadAdjustMode},
{searchPathType, ArgType::ArgTypeVmeSearchPathType}}}); {searchPathType, ArgType::ArgTypeVmeSearchPathType}}});
static_assert(lookup.size() == ArgType::ArgTypeMax - 1, "Every enum field must be present"); static_assert(lookup.size() == ArgType::ArgTypeMax - 1, "Every enum field must be present");
} // namespace ArgType } // namespace ArgType
namespace MemoryAddressingMode { namespace MemoryAddressingMode {
namespace AddrModeTag = Tags::Kernel::PayloadArgument::MemoryAddressingMode; namespace AddrModeTag = Tags::Kernel::PayloadArgument::MemoryAddressingMode;
using AddrMode = Types::Kernel::PayloadArgument::MemoryAddressingMode; using AddrMode = Types::Kernel::PayloadArgument::MemoryAddressingMode;
static constexpr LookupArray<ConstStringRef, AddrMode, 4> lookup({{{AddrModeTag::stateless, AddrMode::MemoryAddressingModeStateless}, constexpr LookupArray<ConstStringRef, AddrMode, 4> lookup({{{AddrModeTag::stateless, AddrMode::MemoryAddressingModeStateless},
{AddrModeTag::stateful, AddrMode::MemoryAddressingModeStateful}, {AddrModeTag::stateful, AddrMode::MemoryAddressingModeStateful},
{AddrModeTag::bindless, AddrMode::MemoryAddressingModeBindless}, {AddrModeTag::bindless, AddrMode::MemoryAddressingModeBindless},
{AddrModeTag::sharedLocalMemory, AddrMode::MemoryAddressingModeSharedLocalMemory}}}); {AddrModeTag::sharedLocalMemory, AddrMode::MemoryAddressingModeSharedLocalMemory}}});
static constexpr ConstStringRef name = "addressing mode"; constexpr ConstStringRef name = "addressing mode";
static_assert(lookup.size() == AddrMode::MemoryAddressIngModeMax - 1, "Every enum field must be present"); static_assert(lookup.size() == AddrMode::MemoryAddressIngModeMax - 1, "Every enum field must be present");
} // namespace MemoryAddressingMode } // namespace MemoryAddressingMode
@@ -74,12 +74,12 @@ namespace AddressSpace {
using namespace Tags::Kernel::PayloadArgument::AddrSpace; using namespace Tags::Kernel::PayloadArgument::AddrSpace;
using AddrSpace = Types::Kernel::PayloadArgument::AddressSpace; using AddrSpace = Types::Kernel::PayloadArgument::AddressSpace;
static constexpr ConstStringRef name = "address space"; constexpr ConstStringRef name = "address space";
static constexpr LookupArray<ConstStringRef, AddrSpace, 5> lookup({{{global, AddrSpace::AddressSpaceGlobal}, constexpr LookupArray<ConstStringRef, AddrSpace, 5> lookup({{{global, AddrSpace::AddressSpaceGlobal},
{local, AddrSpace::AddressSpaceLocal}, {local, AddrSpace::AddressSpaceLocal},
{constant, AddrSpace::AddressSpaceConstant}, {constant, AddrSpace::AddressSpaceConstant},
{image, AddrSpace::AddressSpaceImage}, {image, AddrSpace::AddressSpaceImage},
{sampler, AddrSpace::AddressSpaceSampler}}}); {sampler, AddrSpace::AddressSpaceSampler}}});
static_assert(lookup.size() == AddrSpace::AddressSpaceMax - 1, "Every enum field must be present"); static_assert(lookup.size() == AddrSpace::AddressSpaceMax - 1, "Every enum field must be present");
} // namespace AddressSpace } // namespace AddressSpace
@@ -87,82 +87,82 @@ namespace AccessType {
using namespace Tags::Kernel::PayloadArgument::AccessType; using namespace Tags::Kernel::PayloadArgument::AccessType;
using AccessType = Types::Kernel::PayloadArgument::AccessType; using AccessType = Types::Kernel::PayloadArgument::AccessType;
static constexpr ConstStringRef name = "access type"; constexpr ConstStringRef name = "access type";
static constexpr LookupArray<ConstStringRef, AccessType, 3> lookup({{{readonly, AccessType::AccessTypeReadonly}, constexpr LookupArray<ConstStringRef, AccessType, 3> lookup({{{readonly, AccessType::AccessTypeReadonly},
{writeonly, AccessType::AccessTypeWriteonly}, {writeonly, AccessType::AccessTypeWriteonly},
{readwrite, AccessType::AccessTypeReadwrite}}}); {readwrite, AccessType::AccessTypeReadwrite}}});
static_assert(lookup.size() == AccessType::AccessTypeMax - 1, "Every enum field must be present"); static_assert(lookup.size() == AccessType::AccessTypeMax - 1, "Every enum field must be present");
} // namespace AccessType } // namespace AccessType
namespace AllocationType { namespace AllocationType {
using namespace Tags::Kernel::PerThreadMemoryBuffer::AllocationType; using namespace Tags::Kernel::PerThreadMemoryBuffer::AllocationType;
using AllocType = Types::Kernel::PerThreadMemoryBuffer::AllocationType; using AllocType = Types::Kernel::PerThreadMemoryBuffer::AllocationType;
static constexpr ConstStringRef name = "allocation type"; constexpr ConstStringRef name = "allocation type";
static constexpr LookupArray<ConstStringRef, AllocType, 3> lookup({{{global, AllocType::AllocationTypeGlobal}, constexpr LookupArray<ConstStringRef, AllocType, 3> lookup({{{global, AllocType::AllocationTypeGlobal},
{scratch, AllocType::AllocationTypeScratch}, {scratch, AllocType::AllocationTypeScratch},
{slm, AllocType::AllocationTypeSlm}}}); {slm, AllocType::AllocationTypeSlm}}});
static_assert(lookup.size() == AllocType::AllocationTypeMax - 1, "Every enum field must be present"); static_assert(lookup.size() == AllocType::AllocationTypeMax - 1, "Every enum field must be present");
} // namespace AllocationType } // namespace AllocationType
namespace MemoryUsage { namespace MemoryUsage {
using namespace NEO::Elf::ZebinKernelMetadata::Tags::Kernel::PerThreadMemoryBuffer::MemoryUsage; using namespace NEO::Elf::ZebinKernelMetadata::Tags::Kernel::PerThreadMemoryBuffer::MemoryUsage;
using MemoryUsage = NEO::Elf::ZebinKernelMetadata::Types::Kernel::PerThreadMemoryBuffer::MemoryUsage; using MemoryUsage = NEO::Elf::ZebinKernelMetadata::Types::Kernel::PerThreadMemoryBuffer::MemoryUsage;
static constexpr ConstStringRef name = "memory usage"; constexpr ConstStringRef name = "memory usage";
static constexpr LookupArray<ConstStringRef, MemoryUsage, 3> lookup({{{privateSpace, MemoryUsage::MemoryUsagePrivateSpace}, constexpr LookupArray<ConstStringRef, MemoryUsage, 3> lookup({{{privateSpace, MemoryUsage::MemoryUsagePrivateSpace},
{spillFillSpace, MemoryUsage::MemoryUsageSpillFillSpace}, {spillFillSpace, MemoryUsage::MemoryUsageSpillFillSpace},
{singleSpace, MemoryUsage::MemoryUsageSingleSpace}}}); {singleSpace, MemoryUsage::MemoryUsageSingleSpace}}});
static_assert(lookup.size() == MemoryUsage::MemoryUsageMax - 1, "Every enum field must be present"); static_assert(lookup.size() == MemoryUsage::MemoryUsageMax - 1, "Every enum field must be present");
} // namespace MemoryUsage } // namespace MemoryUsage
namespace ImageType { namespace ImageType {
using namespace Tags::Kernel::PayloadArgument::ImageType; using namespace Tags::Kernel::PayloadArgument::ImageType;
using ImageType = Types::Kernel::PayloadArgument::ImageType; using ImageType = Types::Kernel::PayloadArgument::ImageType;
static constexpr ConstStringRef name = "image type"; constexpr ConstStringRef name = "image type";
static constexpr LookupArray<ConstStringRef, ImageType, 16> lookup({{{imageTypeBuffer, ImageType::ImageTypeBuffer}, constexpr LookupArray<ConstStringRef, ImageType, 16> lookup({{{imageTypeBuffer, ImageType::ImageTypeBuffer},
{imageType1D, ImageType::ImageType1D}, {imageType1D, ImageType::ImageType1D},
{imageType1DArray, ImageType::ImageType1DArray}, {imageType1DArray, ImageType::ImageType1DArray},
{imageType2D, ImageType::ImageType2D}, {imageType2D, ImageType::ImageType2D},
{imageType2DArray, ImageType::ImageType2DArray}, {imageType2DArray, ImageType::ImageType2DArray},
{imageType3D, ImageType::ImageType3D}, {imageType3D, ImageType::ImageType3D},
{imageTypeCube, ImageType::ImageTypeCube}, {imageTypeCube, ImageType::ImageTypeCube},
{imageTypeCubeArray, ImageType::ImageTypeCubeArray}, {imageTypeCubeArray, ImageType::ImageTypeCubeArray},
{imageType2DDepth, ImageType::ImageType2DDepth}, {imageType2DDepth, ImageType::ImageType2DDepth},
{imageType2DArrayDepth, ImageType::ImageType2DArrayDepth}, {imageType2DArrayDepth, ImageType::ImageType2DArrayDepth},
{imageType2DMSAA, ImageType::ImageType2DMSAA}, {imageType2DMSAA, ImageType::ImageType2DMSAA},
{imageType2DMSAADepth, ImageType::ImageType2DMSAADepth}, {imageType2DMSAADepth, ImageType::ImageType2DMSAADepth},
{imageType2DArrayMSAA, ImageType::ImageType2DArrayMSAA}, {imageType2DArrayMSAA, ImageType::ImageType2DArrayMSAA},
{imageType2DArrayMSAADepth, ImageType::ImageType2DArrayMSAADepth}, {imageType2DArrayMSAADepth, ImageType::ImageType2DArrayMSAADepth},
{imageType2DMedia, ImageType::ImageType2DMedia}, {imageType2DMedia, ImageType::ImageType2DMedia},
{imageType2DMediaBlock, ImageType::ImageType2DMediaBlock}}}); {imageType2DMediaBlock, ImageType::ImageType2DMediaBlock}}});
static_assert(lookup.size() == ImageType::ImageTypeMax - 1, "Every enum field must be present"); static_assert(lookup.size() == ImageType::ImageTypeMax - 1, "Every enum field must be present");
} // namespace ImageType } // namespace ImageType
namespace SamplerType { namespace SamplerType {
using namespace Tags::Kernel::PayloadArgument::SamplerType; using namespace Tags::Kernel::PayloadArgument::SamplerType;
using SamplerType = Types::Kernel::PayloadArgument::SamplerType; using SamplerType = Types::Kernel::PayloadArgument::SamplerType;
static constexpr ConstStringRef name = "sampler type"; constexpr ConstStringRef name = "sampler type";
static constexpr LookupArray<ConstStringRef, SamplerType, 12> lookup({{{samplerTypeTexture, SamplerType::SamplerTypeTexture}, constexpr LookupArray<ConstStringRef, SamplerType, 12> lookup({{{samplerTypeTexture, SamplerType::SamplerTypeTexture},
{samplerType8x8, SamplerType::SamplerType8x8}, {samplerType8x8, SamplerType::SamplerType8x8},
{samplerType2DConsolve8x8, SamplerType::SamplerType2DConvolve8x8}, {samplerType2DConsolve8x8, SamplerType::SamplerType2DConvolve8x8},
{samplerTypeErode8x8, SamplerType::SamplerTypeErode8x8}, {samplerTypeErode8x8, SamplerType::SamplerTypeErode8x8},
{samplerTypeDilate8x8, SamplerType::SamplerTypeDilate8x8}, {samplerTypeDilate8x8, SamplerType::SamplerTypeDilate8x8},
{samplerTypeMinMaxFilter8x8, SamplerType::SamplerTypeMinMaxFilter8x8}, {samplerTypeMinMaxFilter8x8, SamplerType::SamplerTypeMinMaxFilter8x8},
{samplerTypeCentroid8x8, SamplerType::SamplerTypeBoolCentroid8x8}, {samplerTypeCentroid8x8, SamplerType::SamplerTypeBoolCentroid8x8},
{samplerTypeBoolCentroid8x8, SamplerType::SamplerTypeBoolCentroid8x8}, {samplerTypeBoolCentroid8x8, SamplerType::SamplerTypeBoolCentroid8x8},
{samplerTypeBoolSum8x8, SamplerType::SamplerTypeBoolSum8x8}, {samplerTypeBoolSum8x8, SamplerType::SamplerTypeBoolSum8x8},
{samplerTypeVME, SamplerType::SamplerTypeVME}, {samplerTypeVME, SamplerType::SamplerTypeVME},
{samplerTypeVE, SamplerType::SamplerTypeVE}, {samplerTypeVE, SamplerType::SamplerTypeVE},
{samplerTypeVD, SamplerType::SamplerTypeVD}}}); {samplerTypeVD, SamplerType::SamplerTypeVD}}});
static_assert(lookup.size() == SamplerType::SamplerTypeMax - 1, "Every enum field must be present"); static_assert(lookup.size() == SamplerType::SamplerTypeMax - 1, "Every enum field must be present");
} // namespace SamplerType } // namespace SamplerType
namespace ThreadSchedulingMode { namespace ThreadSchedulingMode {
using namespace Tags::Kernel::ExecutionEnv::ThreadSchedulingMode; using namespace Tags::Kernel::ExecutionEnv::ThreadSchedulingMode;
using ThreadSchedulingMode = Types::Kernel::ExecutionEnv::ThreadSchedulingMode; using ThreadSchedulingMode = Types::Kernel::ExecutionEnv::ThreadSchedulingMode;
static constexpr ConstStringRef name = "thread scheduling mode"; constexpr ConstStringRef name = "thread scheduling mode";
static constexpr LookupArray<ConstStringRef, ThreadSchedulingMode, 3> lookup({{{ageBased, ThreadSchedulingMode::ThreadSchedulingModeAgeBased}, constexpr LookupArray<ConstStringRef, ThreadSchedulingMode, 3> lookup({{{ageBased, ThreadSchedulingMode::ThreadSchedulingModeAgeBased},
{roundRobin, ThreadSchedulingMode::ThreadSchedulingModeRoundRobin}, {roundRobin, ThreadSchedulingMode::ThreadSchedulingModeRoundRobin},
{roundRobinStall, ThreadSchedulingMode::ThreadSchedulingModeRoundRobinStall}}}); {roundRobinStall, ThreadSchedulingMode::ThreadSchedulingModeRoundRobinStall}}});
static_assert(lookup.size() == ThreadSchedulingMode::ThreadSchedulingModeMax - 1, "Every enum field must be present"); static_assert(lookup.size() == ThreadSchedulingMode::ThreadSchedulingModeMax - 1, "Every enum field must be present");
} // namespace ThreadSchedulingMode } // namespace ThreadSchedulingMode

View File

@@ -140,7 +140,7 @@ constexpr const char *consumeStringLiteral(ConstStringRef wholeText, const char
using TokenId = uint32_t; using TokenId = uint32_t;
static constexpr TokenId invalidTokenId = std::numeric_limits<TokenId>::max(); constexpr TokenId invalidTokenId = std::numeric_limits<TokenId>::max();
struct Token { struct Token {
enum Type : uint8_t { Identifier, enum Type : uint8_t { Identifier,
@@ -280,7 +280,7 @@ constexpr ConstStringRef inlineCollectionYamlErrorMsg = "NEO::Yaml : Inline coll
bool tokenize(ConstStringRef text, LinesCache &outLines, TokensCache &outTokens, std::string &outErrReason, std::string &outWarning); bool tokenize(ConstStringRef text, LinesCache &outLines, TokensCache &outTokens, std::string &outErrReason, std::string &outWarning);
using NodeId = uint32_t; using NodeId = uint32_t;
static constexpr NodeId invalidNodeID = std::numeric_limits<NodeId>::max(); constexpr NodeId invalidNodeID = std::numeric_limits<NodeId>::max();
struct alignas(32) Node { struct alignas(32) Node {
TokenId key = invalidTokenId; TokenId key = invalidTokenId;

View File

@@ -18,7 +18,7 @@
namespace NEO { namespace NEO {
static constexpr NEO::Elf::ZebinKernelMetadata::Types::Version zeInfoDecoderVersion{1, 15}; constexpr NEO::Elf::ZebinKernelMetadata::Types::Version zeInfoDecoderVersion{1, 15};
struct ZebinSections { struct ZebinSections {
using SectionHeaderData = NEO::Elf::Elf<Elf::EI_CLASS_64>::SectionHeaderAndData; using SectionHeaderData = NEO::Elf::Elf<Elf::EI_CLASS_64>::SectionHeaderAndData;

View File

@@ -10,7 +10,7 @@
#include <vector> #include <vector>
namespace NEO { namespace NEO {
static const std::vector<unsigned short> ehlDeviceIds{ inline const std::vector<unsigned short> ehlDeviceIds{
0x4500, 0x4500,
0x4541, 0x4541,
0x4551, 0x4551,

View File

@@ -10,7 +10,7 @@
#include <vector> #include <vector>
namespace NEO { namespace NEO {
static const std::vector<unsigned short> icllpDeviceIds{ inline const std::vector<unsigned short> icllpDeviceIds{
0xFF05, 0xFF05,
0x8A56, 0x8A56,
0x8A58, 0x8A58,

View File

@@ -10,5 +10,5 @@
#include <vector> #include <vector>
namespace NEO { namespace NEO {
static const std::vector<unsigned short> lkfDeviceIds{0x9840}; inline const std::vector<unsigned short> lkfDeviceIds{0x9840};
} // namespace NEO } // namespace NEO

View File

@@ -10,5 +10,5 @@
#include <vector> #include <vector>
namespace NEO { namespace NEO {
static const std::vector<unsigned short> adlnDeviceIds{0x46D0, 0x46D1, 0x46D2}; inline const std::vector<unsigned short> adlnDeviceIds{0x46D0, 0x46D1, 0x46D2};
} // namespace NEO } // namespace NEO

View File

@@ -10,7 +10,7 @@
#include <vector> #include <vector>
namespace NEO { namespace NEO {
static const std::vector<unsigned short> adlpDeviceIds{ inline const std::vector<unsigned short> adlpDeviceIds{
0x46A0, 0x46A0,
0x46B0, 0x46B0,
0x46A1, 0x46A1,

View File

@@ -10,7 +10,7 @@
#include <vector> #include <vector>
namespace NEO { namespace NEO {
static const std::vector<unsigned short> adlsDeviceIds{ inline const std::vector<unsigned short> adlsDeviceIds{
0x4680, 0x4680,
0x4682, 0x4682,
0x4688, 0x4688,

View File

@@ -10,7 +10,7 @@
#include <vector> #include <vector>
namespace NEO { namespace NEO {
static const std::vector<unsigned short> dg1DeviceIds{ inline const std::vector<unsigned short> dg1DeviceIds{
0x4905, 0x4905,
0x4906, 0x4906,
0x4907, 0x4907,

View File

@@ -10,7 +10,7 @@
#include <vector> #include <vector>
namespace NEO { namespace NEO {
static const std::vector<unsigned short> rklDeviceIds{ inline const std::vector<unsigned short> rklDeviceIds{
0x4C80, 0x4C80,
0x4C8A, 0x4C8A,
0x4C8B, 0x4C8B,

View File

@@ -10,7 +10,7 @@
#include <vector> #include <vector>
namespace NEO { namespace NEO {
static const std::vector<unsigned short> tgllpDeviceIds{ inline const std::vector<unsigned short> tgllpDeviceIds{
0xFF20, 0xFF20,
0x9A49, 0x9A49,
0x9A40, 0x9A40,

View File

@@ -10,7 +10,7 @@
#include <vector> #include <vector>
namespace NEO { namespace NEO {
static const std::vector<unsigned short> bdwDeviceIds{ inline const std::vector<unsigned short> bdwDeviceIds{
0x1602, 0x1602,
0x160A, 0x160A,
0x1606, 0x1606,

View File

@@ -10,7 +10,7 @@
#include <vector> #include <vector>
namespace NEO { namespace NEO {
static const std::vector<unsigned short> bxtDeviceIds{ inline const std::vector<unsigned short> bxtDeviceIds{
0x9906, 0x9906,
0x9907, 0x9907,
0x0A84, 0x0A84,

View File

@@ -10,7 +10,7 @@
#include <vector> #include <vector>
namespace NEO { namespace NEO {
static const std::vector<unsigned short> cflDeviceIds{ inline const std::vector<unsigned short> cflDeviceIds{
0x3E90, 0x3E90,
0x3E93, 0x3E93,
0x3E99, 0x3E99,
@@ -31,14 +31,14 @@ static const std::vector<unsigned short> cflDeviceIds{
0x9BA0, 0x9BA0,
0x9BC0}; 0x9BC0};
static const std::vector<unsigned short> whlDeviceIds{ inline const std::vector<unsigned short> whlDeviceIds{
0x3EA1, 0x3EA1,
0x3EA3, 0x3EA3,
0x3EA4, 0x3EA4,
0x3EA0, 0x3EA0,
0x3EA2}; 0x3EA2};
static const std::vector<unsigned short> cmlDeviceIds{ inline const std::vector<unsigned short> cmlDeviceIds{
0x9B21, 0x9B21,
0x9B41, 0x9B41,
0x9BA2, 0x9BA2,

View File

@@ -10,7 +10,7 @@
#include <vector> #include <vector>
namespace NEO { namespace NEO {
static const std::vector<unsigned short> glkDeviceIds{ inline const std::vector<unsigned short> glkDeviceIds{
0x3184, 0x3184,
0x3185}; 0x3185};
} // namespace NEO } // namespace NEO

View File

@@ -10,8 +10,8 @@
#include <vector> #include <vector>
namespace NEO { namespace NEO {
static const std::vector<unsigned short> amlDeviceIds{0x591C}; inline const std::vector<unsigned short> amlDeviceIds{0x591C};
static const std::vector<unsigned short> kblDeviceIds{ inline const std::vector<unsigned short> kblDeviceIds{
0x5902, 0x5902,
0x590B, 0x590B,
0x590A, 0x590A,

View File

@@ -10,7 +10,7 @@
#include <vector> #include <vector>
namespace NEO { namespace NEO {
static const std::vector<unsigned short> sklDeviceIds{ inline const std::vector<unsigned short> sklDeviceIds{
0x1902, 0x1902,
0x190B, 0x190B,
0x190A, 0x190A,

View File

@@ -17,7 +17,7 @@
namespace NEO { namespace NEO {
static const size_t maxFlushSubrangeCount = 126; inline const size_t maxFlushSubrangeCount = 126;
struct L3Range { struct L3Range {
static constexpr uint64_t minAlignment = MemoryConstants::pageSize; static constexpr uint64_t minAlignment = MemoryConstants::pageSize;
static constexpr uint64_t minAlignmentMask = minAlignment - 1ULL; static constexpr uint64_t minAlignmentMask = minAlignment - 1ULL;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018-2021 Intel Corporation * Copyright (C) 2018-2022 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -9,8 +9,8 @@
#include <cstdint> #include <cstdint>
namespace NEO { namespace NEO {
const uint32_t pipelineSelectEnablePipelineSelectMaskBits = 0x3; constexpr uint32_t pipelineSelectEnablePipelineSelectMaskBits = 0x3;
const uint32_t pipelineSelectMediaSamplerDopClockGateMaskBits = 0x10; constexpr uint32_t pipelineSelectMediaSamplerDopClockGateMaskBits = 0x10;
const uint32_t pipelineSelectMediaSamplerPowerClockGateMaskBits = 0x40; constexpr uint32_t pipelineSelectMediaSamplerPowerClockGateMaskBits = 0x40;
const uint32_t pipelineSelectSystolicModeEnableMaskBits = 0x80; constexpr uint32_t pipelineSelectSystolicModeEnableMaskBits = 0x80;
} // namespace NEO } // namespace NEO

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018-2021 Intel Corporation * Copyright (C) 2018-2022 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -9,12 +9,12 @@
#include <cstddef> #include <cstddef>
#include <cstdint> #include <cstdint>
static const int ptrGarbageContent[16] = { inline const int ptrGarbageContent[16] = {
0x0131, 0x133, 0xA, 0xEF, 0x0131, 0x133, 0xA, 0xEF,
0x0131, 0x133, 0xA, 0xEF, 0x0131, 0x133, 0xA, 0xEF,
0x0131, 0x133, 0xA, 0xEF, 0x0131, 0x133, 0xA, 0xEF,
0x0131, 0x133, 0xA, 0xEF}; 0x0131, 0x133, 0xA, 0xEF};
static const auto ptrGarbage = (void *)ptrGarbageContent; inline const auto ptrGarbage = (void *)ptrGarbageContent;
template <typename T> template <typename T>
inline T ptrOffset(T ptrBefore, size_t offset) { inline T ptrOffset(T ptrBefore, size_t offset) {

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2020-2021 Intel Corporation * Copyright (C) 2020-2022 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -188,7 +188,7 @@ struct ArgTypeTraits {
}; };
namespace { namespace {
static constexpr auto ArgTypeMetadataSize = sizeof(ArgTypeTraits); constexpr auto ArgTypeMetadataSize = sizeof(ArgTypeTraits);
static_assert(ArgTypeMetadataSize <= 4, "Keep it small"); static_assert(ArgTypeMetadataSize <= 4, "Keep it small");
} // namespace } // namespace

View File

@@ -55,12 +55,12 @@ UUID('285208b2-c5e0-5fcb-90bb-7576ed7a9697')
*/ */
using ClassNamesArray = std::array<std::pair<const char *, const std::string>, size_t(DrmResourceClass::MaxSize)>; using ClassNamesArray = std::array<std::pair<const char *, const std::string>, size_t(DrmResourceClass::MaxSize)>;
const ClassNamesArray classNamesToUuid = {std::make_pair("I915_UUID_CLASS_ELF_BINARY", "31203221-8069-5a0a-9d43-94a4d3395ee1"), inline const ClassNamesArray classNamesToUuid = {std::make_pair("I915_UUID_CLASS_ELF_BINARY", "31203221-8069-5a0a-9d43-94a4d3395ee1"),
std::make_pair("I915_UUID_CLASS_ISA_BYTECODE", "53baed0a-12c3-5d19-aa69-ab9c51aa1039"), std::make_pair("I915_UUID_CLASS_ISA_BYTECODE", "53baed0a-12c3-5d19-aa69-ab9c51aa1039"),
std::make_pair("I915_UUID_L0_MODULE_AREA", "a411e82e-16c9-58b7-bfb5-b209b8601d5f"), std::make_pair("I915_UUID_L0_MODULE_AREA", "a411e82e-16c9-58b7-bfb5-b209b8601d5f"),
std::make_pair("I915_UUID_L0_SIP_AREA", "21fd6baf-f918-53cc-ba74-f09aaaea2dc0"), std::make_pair("I915_UUID_L0_SIP_AREA", "21fd6baf-f918-53cc-ba74-f09aaaea2dc0"),
std::make_pair("I915_UUID_L0_SBA_AREA", "ec45189d-97d3-58e2-80d1-ab52c72fdcc1"), std::make_pair("I915_UUID_L0_SBA_AREA", "ec45189d-97d3-58e2-80d1-ab52c72fdcc1"),
std::make_pair("L0_ZEBIN_MODULE", "88d347c1-c79b-530a-b68f-e0db7d575e04")}; std::make_pair("L0_ZEBIN_MODULE", "88d347c1-c79b-530a-b68f-e0db7d575e04")};
constexpr auto uuidL0CommandQueueName = "L0_COMMAND_QUEUE"; constexpr auto uuidL0CommandQueueName = "L0_COMMAND_QUEUE";
constexpr auto uuidL0CommandQueueHash = "285208b2-c5e0-5fcb-90bb-7576ed7a9697"; // L0_UUID('L0_COMMAND_QUEUE') constexpr auto uuidL0CommandQueueHash = "285208b2-c5e0-5fcb-90bb-7576ed7a9697"; // L0_UUID('L0_COMMAND_QUEUE')

View File

@@ -10,6 +10,6 @@
#include <vector> #include <vector>
namespace NEO { namespace NEO {
static const std::vector<unsigned short> pvcXlDeviceIds{0x0BD0}; inline const std::vector<unsigned short> pvcXlDeviceIds{0x0BD0};
static const std::vector<unsigned short> pvcXtDeviceIds{0x0BD5, 0x0BD6, 0x0BD7, 0x0BD8, 0x0BD9, 0x0BDA, 0x0BDB}; inline const std::vector<unsigned short> pvcXtDeviceIds{0x0BD5, 0x0BD6, 0x0BD7, 0x0BD8, 0x0BD9, 0x0BDA, 0x0BDB};
} // namespace NEO } // namespace NEO

View File

@@ -10,7 +10,7 @@
#include <vector> #include <vector>
namespace NEO { namespace NEO {
static const std::vector<unsigned short> dg2G10DeviceIds{ inline const std::vector<unsigned short> dg2G10DeviceIds{
0x4F80, 0x4F80,
0x4F81, 0x4F81,
0x4F82, 0x4F82,
@@ -24,7 +24,7 @@ static const std::vector<unsigned short> dg2G10DeviceIds{
0x56A2, 0x56A2,
0x56C0}; 0x56C0};
static const std::vector<unsigned short> dg2G11DeviceIds{ inline const std::vector<unsigned short> dg2G11DeviceIds{
0x4F87, 0x4F87,
0x4F88, 0x4F88,
0x5693, 0x5693,
@@ -36,7 +36,7 @@ static const std::vector<unsigned short> dg2G11DeviceIds{
0x56B1, 0x56B1,
0x56C1}; 0x56C1};
static const std::vector<unsigned short> dg2G12DeviceIds{ inline const std::vector<unsigned short> dg2G12DeviceIds{
0x5696, 0x5696,
0x5697, 0x5697,
0x56A3, 0x56A3,

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2021 Intel Corporation * Copyright (C) 2021-2022 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@@ -15,7 +15,7 @@
#include <dxgi.h> #include <dxgi.h>
namespace NEO { namespace NEO {
static constexpr auto error = 1; constexpr auto error = 1;
class UltDxCoreAdapter : public IDXCoreAdapter { class UltDxCoreAdapter : public IDXCoreAdapter {
public: public:

View File

@@ -10,9 +10,10 @@
#include "shared/source/os_interface/windows/gdi_interface.h" #include "shared/source/os_interface/windows/gdi_interface.h"
#include "shared/source/os_interface/windows/wddm/adapter_info.h" #include "shared/source/os_interface/windows/wddm/adapter_info.h"
static constexpr D3DKMT_HANDLE validHandle = 0x7; constexpr D3DKMT_HANDLE validHandle = 0x7;
static constexpr auto error = STATUS_SUCCESS + 1; constexpr auto error = STATUS_SUCCESS + 1;
static const wchar_t *driverStorePathStr = L"some/path/fffff"; inline const wchar_t *driverStorePathStr = L"some/path/fffff";
struct QueryAdapterInfoMock { struct QueryAdapterInfoMock {
static NTSTATUS(APIENTRY queryadapterinfo)( static NTSTATUS(APIENTRY queryadapterinfo)(
const D3DKMT_QUERYADAPTERINFO *queryAdapterInfo) { const D3DKMT_QUERYADAPTERINFO *queryAdapterInfo) {