This change replaces mechanism of patching global constants and
variables in kernel per relocation to patching them only once. This
would improve linking time performance for kernels with multiple global
symbols.
Signed-off-by: Luzynski, Sebastian Jozef <sebastian.jozef.luzynski@intel.com>
Automatically add "-s" (source path) option if -g flag is present.
This applies only to non-spirv input.
- Due to conflict, do not automatically append source path when
CMC compiler is used.
- Minor code refactor: use defined compiler options instead of local
strings; wrap filename in quotes (in case of space-separated filename
string).
Related-To: NEO-7285
Signed-off-by: Kacper Nowak kacper.nowak@intel.com
Automatically add "-s" (source path) option if -g flag is present.
This applies only to non-spirv input.
- Due to conflict, do not automatically append source path when
CMC compiler is used.
Related-To: NEO-7285
Signed-off-by: Kacper Nowak kacper.nowak@intel.com
This commit adds support for 32 bit zebinary in NEO runtime and in
ocloc validate.
Resolves: NEO-7288
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
Automatically add "-s" (source path) option if -g flag is present.
This applies only to non-spirv input.
Related-To: NEO-7285
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
This commits add support for relocating
symbols with local binding and of functional type
(STB_LOCAL, STT_FUNC).
Related-To: NEO-7299
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
Discarding RAII lock returned from function almost always
is a bug. This change introduces usage of [[no_discard]]
attribute from C++17 to prevent such misues.
Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
This change:
- removes redundant copying of std::vector
- removes unneeded includes from the header file
and introduces usage of forward declaration
Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
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 change removes unneeded recalculation of hash as well
as redundant calls to std::to_string().
Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
In decodeElfSymbolTableAndRelocations, when symbol's section is of
unknown type, then do not add it to linker's symbol table.
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
feat(zebin): Use addend from RELA sections when performing relocations.
Resolves: NEO-6898
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
This commit removes early fail in linking with zebin and external
functions which happens when, there's a relocation to external functions
section, but it's not modifying any external function. And only treats
GLOBAL FUNC symbols pointing to external functions section as external
function symbols.
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
This commit adds check in Linker::resolveExternalFunctions checking
if external functions are present before trying to resolve dependencies
and adds default values for ExternalFunctionInfo.
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
This change allows for modifying kernel's barrier count
based on called external functions metadata passed
via zeInfo section in zebin.
Added parsing external functions metadata.
Added resolving external functions call graph.
Added updating kernel barriers based on called external functions.
Added support for L0 dynamic link.
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
This commit adds support for querying global pointers via decorated
names passed in zeInfo.
Related-To: NEO-6734
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
Related-To: NEO-6075
After this change driver will fail clBuildProgram/zeModuleCreate api calls
whenever stateful access is discovered on PVC.
This is required since in this case allocation greater than 4GB
will not work.
If user still wants to use stateful addressing mode,
-cl-opt-smaller-than-4GB-buffers-only / -ze-opt-smaller-than-4GB-buffers-only
build option should be passed as build option, but then user can not use
bufers greater than 4GB.
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>