Commit Graph

72 Commits

Author SHA1 Message Date
Artur Harasimiuk 22505ca3ed refactor: cleanup coding style
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
2024-10-02 12:42:39 +02:00
Fabian Zwoliński 359f4d5b56 feature: add SUPPORTED_DEVICES query to ocloc
New query option
ocloc query SUPPORTED_DEVICE
allows to generate a YAML file containing
information about supported devices for:
- the current version of ocloc on Windows
- the current and previous versions of ocloc on Linux

Each version of ocloc build needs to set
NEO_OCLOC_CURRENT_LIB_NAME
NEO_OCLOC_FORMER_LIB_NAME
cmake defines for the ocloc to be able to
find a previous lib and query its supported devices.

Example of correct format:
NEO_OCLOC_FORMER_LIB_NAME=libocloc-1.0.so
NEO_OCLOC_CURRENT_LIB_NAME=libocloc-2.0.so

Related-To: NEO-9630
Signed-off-by: Fabian Zwoliński <fabian.zwolinski@intel.com>
2024-07-11 17:38:33 +02:00
Mateusz Hoppe 037957a7ae feature: add -stateful_address_mode to ocloc
- allows to choose bindless or bindful addressing in generated code

Related-To: NEO-11704

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2024-06-12 07:46:12 +02:00
Mateusz Jablonski cfd5f0c9b3 fix: use .spv for intermediate representation
Related-To: NEO-7785
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2024-06-11 12:06:57 +02:00
Compute-Runtime-Validation f4106ca44c Revert "fix: use .spv for intermediate representation"
This reverts commit 6c9bca8cdc.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2024-06-11 05:57:05 +02:00
Mateusz Jablonski 6c9bca8cdc fix: use .spv for intermediate representation
Related-To: NEO-7785
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2024-06-10 15:38:50 +02:00
Chodor, Jaroslaw b58717b9e3 feature: Add support for legacy acronyms in ocloc's fatbinary
Expands support for deprecated acronyms to fatbinary. Previously,
these were allowed only in single-target builds.

Related-To: NEO-10190

Signed-off-by: Chodor, Jaroslaw <jaroslaw.chodor@intel.com>
2024-02-15 10:14:49 +01:00
Chodor, Jaroslaw 7e795cd3c1 feature: Adding support for OCL C support queries to ocloc
Feature needed for automated OCL C compilation with ocloc as backend.
Added queries :
* CL_DEVICE_EXTENSIONS
* CL_DEVICE_EXTENSIONS_WITH_VERSION
* CL_DEVICE_PROFILE
* CL_DEVICE_OPENCL_C_ALL_VERSIONS
* CL_DEVICE_OPENCL_C_FEATURES

Sample command line:
ocloc query -device skl CL_DEVICE_OPENCL_C_FEATURES

Related-To: GSD-7420

Signed-off-by: Chodor, Jaroslaw <jaroslaw.chodor@intel.com>
2023-12-18 15:19:16 +01:00
Mateusz Jablonski 35c1f34672 refactor: move number of threads per eu to release helper
Related-To: HSD-18034098647
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-11-20 12:16:33 +01:00
Fabian Zwolinski 7ac0c4ba37 feature: add ocloc IGC_REVISION query
Related-To: NEO-8289
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-09-26 15:57:11 +02:00
Fabian Zwolinski b2ba1fbecf fix: enforce zebin format by default in Ocloc for ICL/TGL/RKL/ADL
Products for which zebin has been set as default format in OCLOC:
- ICELAKE_LP
- TIGERLAKE_LP
- ROCKETLAKE
- ALDERLAKE_S
- ALDERLAKE_P
- ALDERLAKE_N

The default format does not override `--format` parameter.

Related-To: NEO-8334
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-09-08 16:16:18 +02:00
Fabian Zwolinski 41914be8c3 fix: enforce zebin format by default in Ocloc
Related-To: NEO-8334
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-09-06 15:22:01 +02:00
Mateusz Jablonski 02337bbbf8 refactor: remove not needed includes from ocloc sources
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-07-28 18:56:16 +02:00
Maciej Plewka 3a9a835692 fix: encode options in elf file
Resolves: NEO-8035

Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
2023-07-11 16:31:52 +02:00
Fabian Zwolinski d00345d115 feature: Add ability to specify options per-device in Ocloc
Related-To: NEO-8037
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-06-06 19:33:48 +02:00
Kamil Kopryk 7d20449589 fix: Add release helper for dg2
Related-To: NEO-7786
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
2023-05-16 12:04:03 +02:00
Mateusz Hoppe 252c5a99cf feature: ocloc - add new option for output binary filename
- new option "-o [filename]" allows to set output binary filename, ocloc
will not add any extension to the name
- no other files will be produced (.spv/.cpp/.dbg)
Related-To: NEO-7935

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-05-10 02:24:59 +02:00
Daria Hinz 2647efc23c feat: Add support for ip version value in ocloc
Ocloc supports passing hw ip version value to -device arg in
the form of major.minor.revision.
This change adds support for directly passed value as uint32_t as well.
Support added for single and fat binary.

Signed-off-by: Daria Hinz <daria.hinz@intel.com>
Related-To: NEO-7903
2023-04-20 13:20:11 +02:00
Mateusz Jablonski 2e872c1871 fix ocloc: don't fail when help parameter is passed to ocloc compile
https://github.com/intel/compute-runtime/issues/621

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-03-06 10:08:00 +01:00
Warchulski, Jaroslaw 0556d543a3 Cleanup includes 56
Related-To: NEO-5548
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2023-02-16 14:42:44 +01:00
Daria Hinz 59109a08bb Switch device ID support to product config helper
This commit switches the device ID logic from the deprecated
to the new one, so that if the user passes a hex value to the -device
parameter, ocloc will use the new implementation in the product config
helper. The change also introduces a fix for setting the values in the
correct order to configure the hwIfno correctly.

Signed-off-by: Daria Hinz daria.hinz@intel.com
Related-To: NEO-7487
2023-02-03 16:55:41 +01:00
Kamil Kopryk 7487d1450e Move CompilerProductHelper ownership to RootDeviceEnvironment and Ocloc
Related-To: NEO-6853
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
2023-02-01 13:09:12 +01:00
Mateusz Jablonski 4647180c76 refactor: remove platform type string
this property is no longer needed as we compile kernels per product family

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-01-04 13:48:16 +01:00
Compute-Runtime-Validation 5a6d358166 Revert "refactor: remove platform type string"
This reverts commit 58b443ecf1.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2023-01-04 11:08:51 +01:00
Mateusz Jablonski 58b443ecf1 refactor: remove platform type string
this property is no longer needed as we compile kernels per product family

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-01-04 09:26:29 +01:00
Compute-Runtime-Validation 4d2948d312 Revert "Use device ID from ProductConfigHelper"
This reverts commit 60a8bcb3d7.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2022-11-11 10:56:33 +01:00
Daria Hinz 60a8bcb3d7 Use device ID from ProductConfigHelper
This commit switches the device ID logic from the deprecated
to the new one, so that if the user passes a hex value to the -device
parameter, ocloc will use the new implementation in the product config
helper.

Signed-off-by: Daria Hinz <daria.hinz@intel.com>
Related-To: NEO-7487
2022-11-08 12:40:54 +01:00
Baj, Tomasz 0eab93501c Add cl_cache mechanism to ocloc
Related-To: NEO-6476

Signed-off-by: Baj, Tomasz <tomasz.baj@intel.com>
2022-09-30 12:03:02 +02:00
Daria Hinz 91a97dfaea Restore old device id design in ocloc
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>
2022-07-19 15:55:13 +02:00
Daria Hinz 01af53b63c Setting default device id for acronym
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
2022-07-15 12:28:58 +02:00
Kamil Kopryk 7c538b956a Correct typo
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
2022-07-14 10:13:12 +02:00
Daria Hinz ea2edbef3d Add ids command to ocloc
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
2022-07-07 11:18:36 +02:00
Daria Hinz 789dd1900e Add -config flag to ocloc
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>
2022-07-05 11:36:01 +02:00
Daria Hinz 6d365cbfc3 Ocloc: New AOT design implementation
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>
2022-06-14 13:20:45 +02:00
Compute-Runtime-Validation cca1dbecbc Revert "Ocloc: New AOT approach implementation"
This reverts commit a44f1b43aa.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2022-06-12 21:27:08 +02:00
Daria Hinz a44f1b43aa Ocloc: New AOT approach implementation
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>
2022-06-10 09:24:13 +02:00
Kacper Nowak dd393d11a2 Ocloc: allow enforcing binary format specified by user
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>
2022-04-29 15:30:19 +02:00
Patryk Wrobel 35a04e5915 Refactor and test initialization of FCL in ocloc
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>
2022-04-22 10:25:16 +02:00
Patryk Wrobel 303c12bc5b Refactor and test initialization of IGC in ocloc
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>
2022-04-19 12:15:34 +02:00
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 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
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
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
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
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
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