This commit fixes problem in zebin manipulator when dump was not
created.
* Explicitly create dump directory.
* Add slash to dump argument.
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
This commit adds option to disassemble and assemble zebinary.
Disasm disassembles zebinary into sections. Text sections are
translated to assembly, relocations and symbols are
translated into human readable format.
Asm assembles zebinary from files generated by disasm.
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.
- 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>
Remove code duplication. Parsing zebin elf for relocations and symbols
is moved to decodeSingleDeviceBinary.
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>
With compiler LSC WAs this gives better performance.
If debugger is active, policy will not be changed ie.
will be WBP.
Related-To: NEO-7003
Signed-off-by: Dominik Dabek <dominik.dabek@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>
With compiler LSC WAs this gives better performance.
If debugger is active, policy will not be changed ie.
will be WBP.
Related-To: NEO-7003
Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
Usage of initializer list in for loop to iterate over heavy types
has bad consequences. std::initialize_list is only a view and its
data is silently created as T[N]. Therefore, if someone uses
std::vector with it, it will cause deep-copying of the elements.
This change introduces usage of pointers on std::initializer_list
to perform a shallow-copy of an addresses. Furthermore, it adds
const references in few places, where copy is not needed.
Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
- Extend support for existing platforms [disasm option].
- Do not use deprecated core acronyms.
Related-To: NEO-7235
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
This change removes some of the logic related to
passing device id as an argument in ocloc introduced in
"Setting default device id for acronym".
Signed-off-by: Daria Hinz <daria.hinz@intel.com>
This PR includes:
- Move product config implementation from
ocloc arg helper to product config helper.
- Add default device id setting for each platform configuration.
- Add & move hw info config tests from opencl to shared
Signed-off-by: Daria Hinz <daria.hinz@intel.com>
Related-To: NEO-7112
New command usage: ocloc ids <acronym>.
It will allow the user to query all matched
<major>.<minor>.<revision> for the specified acronym.
E.g.
ocloc ids dg1
Matched ids:
12.10.0
Signed-off-by: Daria Hinz <daria.hinz@intel.com>
Related-To: NEO-7159
Addition of a -config parameter that will allow
the user to set the number of EUs, slices etc.
Knowing these values during AOT can translate into performance.
Signed-off-by: Daria Hinz <daria.hinz@intel.com>
AOT version (major.minor.revision) is one of
the supported variants for -device arg in ocloc.
In this change, version support has been added
when passing specific targets to -device using ",".
Signed-off-by: Daria Hinz <daria.hinz@intel.com>
Related-To: NEO-7003
Add L1CachePolicyHelper struct.
This struct is resposible for L1 cache policy
in build option, Surface State and stateless
caching. Currently default option for all
platforms is WBP (write by-pass)
Signed-off-by: Szymon Morek <szymon.morek@intel.com>
In addition to supporting the official -device acronyms
(e.g. xe-hpg), support for shorter and deprecated acronyms
has also been added.
An example of supported variances:
- xehpg
- xe_hpg
- xe_hpg_core
Signed-off-by: Daria Hinz <daria.hinz@intel.com>
Related-To: NEO-6910
Ocloc will handle any new values that may be
passed to the -device argument.
Supported acronyms are available under cmd:
ocloc compile --help
Supported patterns:
- device acronym
- release acronym
- family acronym
- version (major.minor.revision)
Fatbinary will no longer handle major.minor.revision variances,
only acronyms allowed.
Signed-off-by: Daria Hinz <daria.hinz@intel.com>
Ocloc will handle any new values that may be
passed to the -device argument.
Supported acronyms are available under cmd:
ocloc compile --help
Supported patterns:
- device acronym
- release acronym
- family acronym
- version (major.minor.revision)
Fatbinary will no longer handle major.minor.revision variances,
only acronyms allowed.
Signed-off-by: Daria Hinz <daria.hinz@intel.com>
In most cases, there was code redundancy, which was minimized in this change.
The setupHardwareInfoBase extraction will also be used for ocloc.
Signed-off-by: Daria Hinz <daria.hinz@intel.com>
Related-To: NEO-6910
In most cases, there was code redundancy, which was minimized in this change.
The setupHardwareInfoBase extraction will also be used in ocloc.
Signed-off-by: Daria Hinz <daria.hinz@intel.com>
Related-To: NEO-6910
This commit adds ocloc option for specifying binary format.
When a --format flag is passed, the internal options will be changed
accordingly to the format specified (zebin/patchtokens) or a warning
will be printed if an unknown format will be passed.
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
This change contains ULTs for BinaryDecoder.
It is intended to improve code coverage.
Related-To: NEO-6834
Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
This change introduces ULTs for buildFatBinary() function.
It is intended to improve code coverage.
Related-To: NEO-6834
Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
This change:
- extracts FCL to a separate class called OclocFclFacade
- tests the new class
- tests its usage in offline compiler
Related-To: NEO-6834
Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
This change:
- implements mock for functions from IGA DLL
- implements ULTs for IgaWrapper
- implements RAII wrapper for GTEST's capture of stdout
- adds ASAN and TSAN flags to ocloc_tests
Related-To: NEO-6834
Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
This change:
- encapsulates initialization of IGC in a separate class
- removes code duplication from OfflineLinker and OfflineCompiler
- tests the new encapsulated class
Related-To: NEO-6834
Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
Change modifies the encoding entry in fatbinary for platforms.
If numbering in -device is used, the value PRODUCT_CONFIG will be encoded.
The functionality that returns the correct product config values has
also been added.
Related-To: NEO-6744
Signed-off-by: Daria Hinz <daria.hinz@intel.com>
This change introduces unit tests related to
member functions of OfflineCompiler class.
OfflineCompiler::initialize() is not covered
and it will be added in a separate commit.
Related-To: NEO-6834
Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
This change contains ULTs, which improve the
coverage of BinaryEncoder and BinaryDecoder
classes.
Related-To: NEO-6834
Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
This change introduces ULTs for untested
parts of MultiCommand class. Furthermore,
it contains MockMultiCommand class, which
allows white-box testing.
Related-To: NEO-6834
Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
User can pass a heximal value of device id via -device param.
This change makes the setting of this value in hwInfo.
Signed-off-by: Daria Hinz <daria.hinz@intel.com>
This change contains ULTs for buildFatBinaryForTarget().
They are intented to cover untested code. Moreover,
the function signature has been changed to avoid copying
of std::vector of arguments.
Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
This change introduces unit tests for Source class,
which is a helper of ocloc_arg_helper.
The original functionality has been improved to preserve
last line even if it does not contain trailing new line sign.
Moreover, empty lines are skipped since this change.
Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
For AOT compilation, we don't want to set random/default values.
The uploaded structure to IGC will be reset.
Signed-off-by: Daria Hinz <daria.hinz@intel.com>
Add dummy option to ocloc cmd. This is a preparation to add
a new option that will control dumping gen file.
Signed-off-by: Mateusz Borzyszkowski <mateusz.borzyszkowski@intel.com>
This change prevents embedding identical SPIR-V section for each
target requested in fatbinary build. Instead of duplicating SPIR-V,
a new file called 'generic_ir' is added to AR archive. It contains
SPIR-V, which was used to build fatbinary. Build fallback in runtime
has been also adjusted - if 'generic_ir' file is defined in fatbinary
and there is no matching binary, then this generic SPIR-V is used to
rebuild for the requested target.
Additionally, MockOclocArgumentHelper::loadDataFromFile() was adjusted
to ensure null-termination of returned strings.
This change also removes possible undefined behavior, which was
related to reading names of files from AR archive. Previously,
if filename was shorter than requested target name, we tried to
read more memory than allowed.
Related-To: NEO-6490
Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
In some cases, when a user passes -device in the form of
<major>.<minor>.<revision> (e.g. 12.0.0) ocloc requests fatBinary.
There is no need to duplicate compatible binaries.
Signed-off-by: Daria Hinz <daria.hinz@intel.com>
Ocloc can dump gen file when we add -gen_file flag to cmd.
Otherwise gen is not generated
Signed-off-by: Mateusz Borzyszkowski <mateusz.borzyszkowski@intel.com>
Added 'link' option to ocloc CLI, which allows linking of
several IR files to single output file. Supported formats
of output file are ELF and LLVM BC.
Related-To: NEO-6163
Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
Suppressing output could be achieved with quiet option "-q",
but some information was gone because of it.
Call to oclocInvoke with output parameters passed should not
print message to stdout. All messages should be stored,
and returned to the user via output as stdout.log file.
This commit turns off printing messages to stdout when
output parameters are present.
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
PVC will support buffers greater than 4GB, hence we have to
use stateless accessing mode as default.
Signed-off-by: Kopryk, Kamil <kamil.kopryk@intel.com>
Currently if ocloc fails and options are read from file, no information
about them will be printed or logged if -q is passed.
With this change, ocloc will print options read from file on compilation
or initialization error.
Related-To: NEO-6002
Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
When ocloc prints the command it was called with, enclose the -options
and -internal_options with quotes.
This allows easier copy-paste of the cmdline.
Related-To: NEO-6002
Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
Unifies usage of flags in case of IR exclusion from ocloc's output file.
When -exclude_ir parameter is active, then internal options passed to
IGC contain -exclude-ir-from-zebin to preserve consistency. Moreover,
when only -exclude-ir-from-zebin is present, then -exclude_ir is also set.
Related-To: NEO-6477
Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
For AOT feature, a new approach to passing
the -device arg to ocloc is implemented.
New character: <Major>.<Minor>.<Revision>
Signed-off-by: Daria Hinz <daria.hinz@intel.com>
Related-To: NEO-5954
Itroduces new parameter "-exclude_ir" to ocloc CLI.
This parameter can be used to reduce output binary size
when IR is not needed.
Related-To: NEO-6477
Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
extract api agnostic validators to shared
remove not needed opencl includes from neo shared
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This allocates the buffer on a per-device basis and enables ray
tracing on devices that support it when given a kernel with ray
tracing calls.
Signed-off-by: Jim Snow <jim.m.snow@intel.com>
Appened ocloc interface with new 'query' feature.
Using this feature now one can extract HEAD hash and version of neo.
Signed-off-by: Bushev, Dmitry <dmitry.bushev@intel.com>
Dates corrected in copyright headers to reflect original publication date
(2018 for OpenCL, 2020 for Level Zero).
Signed-off-by: lgotszal <lukasz.gotszald@intel.com>
debuginfo package contains stripped debug symbols.
Generating debug symbols have been enabled for Release builds.
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>