Commit Graph

161 Commits

Author SHA1 Message Date
Patryk Wrobel 76349b8030 Improve code coverage of OfflineCompiler class
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>
2022-04-07 13:58:52 +02:00
Patryk Wrobel 50efd09ad8 Improve code coverage of binary encoder and decoder
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>
2022-04-04 17:20:01 +02:00
Patryk Wrobel 9cba46e5bf Improve code coverage of MultiCommand class
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>
2022-04-01 14:04:16 +02:00
Daria Hinz 88c16542a1 Ocloc: Set DeviceId in HwInfo
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>
2022-03-29 11:17:23 +02:00
Patryk Wrobel 14c9c57e0c Test buildFatBinaryForTarget()
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>
2022-03-26 08:15:35 +01:00
Patryk Wrobel 41a8972772 Test functionality of Source helper class
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>
2022-03-25 13:52:40 +01:00
Daria Hinz efa57f734b Reset GT_SYSTEM_INFO values in ocloc
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>
2022-03-25 10:17:18 +01:00
Kacper Nowak cc0c98e974 Enable ocloc disasm for .gen files
This commit allows to use "disasm"
ocloc option to be used with .gen files.
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2022-03-24 12:53:22 +01:00
Kamil Kopryk 038d1d54fa Correct xe_hpc tests
Related-To: NEO-6631


Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
2022-03-09 09:21:30 +01:00
Daria Hinz 0c6863766a Set device ids for PRODUCT_CONFIG
Ocloc must set the default device id if the user
selects <major>.<minor>.<revision> pattern.

Signed-off-by: Daria Hinz <daria.hinz@intel.com>
2022-02-25 18:01:40 +01:00
Mateusz Jablonski aae7858ed9 CMake: define enable core files only once
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2022-02-18 11:50:09 +01:00
Compute-Runtime-Validation 84a1ccb991 Revert "Remove overridePlatformName method"
This reverts commit 2484c68fe3.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2022-02-18 10:57:19 +01:00
Bartosz Dunajski 2484c68fe3 Remove overridePlatformName method
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
2022-02-17 16:16:08 +01:00
Mateusz Borzyszkowski 64b8de3c1d Prepare offline compiler to add -gen_file option
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>
2022-02-16 13:10:33 +01:00
Patryk Wrobel 6ac6db7b04 Store single generic IR in fatbinary when built from SPIR-V input
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>
2022-02-14 15:30:46 +01:00
Baj, Tomasz 2eb7ae7a8d ocloc accept underline and shorter gen names
Signed-off-by: Baj, Tomasz <tomasz.baj@intel.com>
Related-To: NEO-6122
2022-02-14 14:55:30 +01:00
Daria Hinz c1eae01ce9 Remove duplicate product configs
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>
2022-02-10 11:44:06 +01:00
Mateusz Hoppe 31a61a16c0 Set ERROR in retValForCrash in SafetyGuard.call()
- allows to print ocloc command line after crash in compilation

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2022-02-02 14:28:51 +01:00
Bartosz Dunajski 90d85bee55 Remove ftrGT flags support
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
2022-01-27 17:39:48 +01:00
Dominik Dabek a83b173bbe Do not abort ocloc when building throws exception
Previously when compiler crashed, no cmdline was printed.

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2022-01-27 12:41:40 +01:00
Bartosz Dunajski 72edadb265 Remove not used GT type info
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
2022-01-26 18:06:38 +01:00
Compute-Runtime-Validation 1634ac9ec3 Revert "Dont generate gen file by default"
This reverts commit 95943dee0f.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2022-01-24 14:46:29 +01:00
Mateusz Borzyszkowski 95943dee0f Dont generate gen file by default
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>
2022-01-17 18:14:50 +01:00
Patryk Wrobel 53482e6821 Allow ocloc to link files
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>
2022-01-14 16:18:36 +01:00
Krystian Chmielewski 0089cb698f OclocInvoke suppress print to stdout if has output
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>
2022-01-11 14:21:23 +01:00
Kopryk, Kamil 7d18b845fa Remove not needed argument from appendExtraInternalOptions function
Signed-off-by: Kopryk, Kamil <kamil.kopryk@intel.com>
2022-01-03 10:35:47 +01:00
Kopryk, Kamil 446a78a134 Force stateless addressing mode for PVC
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>
2021-12-29 14:53:18 +01:00
Dominik Dabek 67fff7fc51 Rename igcFeWa to igcFtrWa
It references features and workarounds

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2021-12-29 11:52:43 +01:00
Dominik Dabek df2e31dbb0 Print ocloc options from file on fail if quiet
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>
2021-12-28 16:50:05 +01:00
Dominik Dabek b6ec17843d Add quotes to options in cmdline printed by ocloc
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>
2021-12-22 17:19:41 +01:00
Patryk Wrobel 09eefb4968 Unify used flags in case of IR exclusion
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>
2021-12-17 14:30:58 +01:00
Daria Hinz 0aeca8df22 New numerical approach to platforms in ocloc
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
2021-12-15 13:02:12 +01:00
Patryk Wrobel c324279bf5 Add support for exclusion of IR from binary generated by ocloc
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>
2021-12-08 16:11:54 +01:00
Bartosz Dunajski 537200dac5 Debug flag support to override revisionId in ocloc
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
2021-11-29 14:34:33 +01:00
Bartosz Dunajski 995cb88bfa Improve ftr/wa flags packing
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
2021-11-25 16:05:57 +01:00
Bartosz Dunajski 29f74a1a98 Rename cmake GEN variables
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
2021-11-24 14:42:57 +01:00
Kamil Kopryk f0cb1cc388 Remove isForceToStatelessRequired from compilerHwInfoConfig helper
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
Related-To: NEO-6075
2021-11-17 17:53:09 +01:00
Kamil Kopryk 7bbb43a563 Move sharedSystemMemCapabilities to hwInfo
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
Related-To: NEO-6075
2021-11-17 14:42:05 +01:00
Kamil Kopryk f1e839bda2 Add ocloc ults
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
2021-11-05 11:30:27 +01:00
Mateusz Jablonski 21ef249961 Move ocl extensions logic to shared
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2021-11-04 17:38:15 +01:00
Kamil Kopryk 03540d5301 Refactor per platform extra settings in ocloc
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
Related-To: NEO-6382
2021-10-28 16:24:12 +02:00
Mateusz Jablonski 19b8a03d30 Move some files from opencl/source/dll to shared
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2021-10-22 19:59:55 +02:00
Mateusz Jablonski 664b33787d Move appending compiler extensions to compiler parser
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2021-10-20 16:10:54 +02:00
Dominik Dabek 9ce0f4d0c3 Do not append null char to build log
Related-To: NEO-5989

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2021-10-14 20:59:11 +02:00
Mateusz Jablonski b1df167632 Move enable_product.inl to shared
extract api agnostic validators to shared
remove not needed opencl includes from neo shared


Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2021-10-12 22:02:16 +02:00
Mateusz Hoppe 02d8b3a024 Fix ocloc options parsing
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2021-10-12 13:02:13 +02:00
Mateusz Hoppe b420bc6102 Revert "Fix ocloc options parsing"
This reverts commit ef7a6763cb3e7389542a818e58b3c200b178bc46.

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2021-10-08 13:20:16 +02:00
Kamil Kopryk cfc673b77c Add compilerHwInfoConfig
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
Related-To: NEO-6237
2021-10-06 21:27:34 +02:00
Mateusz Hoppe 8fd49c4e7c Fix ocloc options parsing
"-g" in the middle of another option should not be parsed
as "-g"

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2021-10-06 15:57:53 +02:00
Zbigniew Zdanowicz 25c71a6c13 Move kernel info to shared directory
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
2021-09-29 23:49:49 +02:00