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>