Commit Graph

114 Commits

Author SHA1 Message Date
Daniel Chabrowski 6fd7ae7142 Cleanup headers
Signed-off-by: Daniel Chabrowski <daniel.chabrowski@intel.com>
2022-05-26 17:55:44 +02:00
Neil R Spruit 8c894fad5e Change Packed binary Returned in L0 GetNative to be the Target Device binary
- Packed Binary Returned to a customer in L0 GetNative is now
the target device's native binary.

Signed-off-by: Neil R Spruit <neil.r.spruit@intel.com>
2022-05-25 21:27:45 +02:00
Krystian Chmielewski 359dfc301f Improve elf encoder
This change:
* adds functions for setting members of ElfSymbol, and ElfRela.
* simplifies string section creation in ElfEncoder.
* adds function to query index of section in ElfEncoder.

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2022-05-18 12:20:26 +02:00
Daniel Chabrowski 7463e1970b Cleanup headers
Make TUs and headers self-contained, remove unused headers

Signed-off-by: Daniel Chabrowski <daniel.chabrowski@intel.com>
2022-05-18 11:42:06 +02:00
Kacper Nowak e32738ee4a Set flag indicating corresponding addressing mode in zebin
Set missing flag indicating corresponding addresing mode.
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
Related-To: NEO-6646
2022-05-16 15:16:25 +02:00
Artur Harasimiuk a6490062a9 fix code issues reported by clang 14
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
2022-04-29 10:43:34 +02:00
Mateusz Jablonski ac01f74924 style: fix gcc12 compilation errors
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2022-04-28 18:07:15 +02:00
Krystian Chmielewski e007ba499f feat(zebin): add support for build options section
This change:
* Adds support for build options section in zebinary - using
build options in binary when rebuilding.
* Appends "-cl-intel-allow-zebin" flag to build options when zebin is
used.

Resolves: NEO-6916

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2022-04-27 11:26:42 +02:00
Krystian Chmielewski 5c120f5f2d fix: Ignore unsupported relocs in debug zebin
Do not apply relocations with types different than {1, 2, 3}, when creating
debug zebin.

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2022-04-21 13:47:13 +02:00
Kacper Nowak 1a33fc0dc7 Zebin: return error on parsing empty vector entries in zeInfo
This commit prevents a yaml parsing error in case a data type is passed
after empty vetor type data entry with the same indendation. In this
case, a parsing error will be returned.
- Corrected .ze_info section in valid empty program (zebin mock)
- Minor ults refactor in order to use mock zebin program with valid
.ze_info

Related-To: NEO-6735
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2022-04-19 13:12:47 +02:00
Krystian Chmielewski 7a64982822 Debug Zebin pass kernel's address
feat: Set text sections' addresses with valid GPU VA. Offset debug symbols
with text segment names by corresponding segment's GPU VA.

Resolves: NEO-6873

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2022-04-13 08:38:49 +02:00
Krystian Chmielewski ee0d183cf9 Handle legacy hasBarriers properly
Previous change regarding NEO-6785 added encoding of number of barriers
to specific value representation depending on hardware that we program for.

In patch token format encoding of number of barriers is sent via
hasBarriers field in a token.
In zebin true number of barriers is sent via barrier_count field in
zeInfo.

To remove this discrepancy, translate encoded number of barriers into
true number of barriers in legacy format.

Resolves: NEO-6785

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2022-04-12 09:44:10 +02:00
Krystian Chmielewski 01a719cf33 Allow for zebin rebuild when IR is present
This commits adds rebuilding zebin binary.
If zebin is built for different device and has SPIRV, then new ze binary
will be built using SPIRV.

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2022-04-12 08:05:25 +02:00
Daria Hinz ce645f13b7 Encode PRODUCT_CONFIG value into fatbinary
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>
2022-04-11 15:09:17 +02:00
Compute-Runtime-Validation 64d3f95410 Revert "Allow for zebin rebuild when IR is present"
This reverts commit 2ae3f3e521.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2022-04-06 23:17:22 +02:00
Krystian Chmielewski 2ae3f3e521 Allow for zebin rebuild when IR is present
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2022-04-05 10:25:06 +02:00
Kacper Nowak afd71beee9 Add slm_alignment entry to .zeInfo payload_arguments section
This commit adds suport for parsing "slm_alignment" entry in .ze_info
section.
- Set requiredSlmAlignment for addresing mode slm
- Enable optional passed slm alignment parsing (with default value=16
left).

Related-To: NEO-6817
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2022-03-31 12:00:16 +02:00
Kacper Nowak 1b6a907b13 Code refactor
This commit:
- Optimizes usage of std::unordered map
- Corrects variables naming and output messages
- Minor changes in using std::string methods
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2022-03-23 23:12:21 +01:00
Kacper Nowak 50aeae41bf Remove custom _PATCH_TOKEN_GLOBAL_HOST_ACCESS_TABLE definition
This commit removes custom definition of
_PATCH_TOKEN_GLOBAL_HOST_ACCESS_TABLE and
instead uses one provided by IGC.
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2022-03-21 10:44:27 +01:00
Kacper Nowak 86434e485d Move PATCH_TOKEN_GLOBAL_HOST_ACCESS_TABLE to kernel scope tokens
This commit moves patch token with global host access table to the
kernel scope from the program scope.

Related-To: NEO-6734
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2022-03-16 12:58:25 +01:00
Krystian Chmielewski 1b4319fdab Update zebin note target metadata
This commit removes ZebinTargetMetadata struct, and uses
ZebinTargetFlags for both target validations: via machine type, and
via intel gt notes.

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2022-03-10 16:47:01 +01:00
Kacper Nowak c5ff07237b Patchtokens: Add support for querying device globals by host name
This commit enables parsing symbol infos
passed in the PATCH_TOKEN_PROGRAM_SYMBOL_TABLE patchtoken.
Related-To: NEO-6734
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2022-03-04 14:38:19 +01:00
Krystian Chmielewski 0ccce5a6d7 Zebin: set kernel barriers based on ext funcs
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>
2022-03-04 14:21:50 +01:00
Kacper Nowak 38086029ed Zebin: Add support for querying device globals by host name
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>
2022-03-03 13:13:22 +01:00
Konstanty Misiak cf1bc3a2ba Disable EU fusion based on kernel properties from compiler
Related-To: NEO-6633

Signed-off-by: Konstanty Misiak <konstanty.misiak@intel.com>
2022-02-28 18:50:38 +01:00
Mateusz Jablonski 82e3b10c5a Fix typo
Related-To: NEO-5081
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2022-02-25 18:10:41 +01:00
Katarzyna Cencelewska 93efb2c63f Move DATA_PARAMETER_CHILD_BLOCK_SIMD_SIZE to ignore
Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com>
2022-02-25 10:29:58 +01:00
Mateusz Jablonski 3b7fbef826 Handle implicit args buffer info in zebin
Related-To: NEO-5081, IGC-4710
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2022-02-24 19:43:21 +01:00
Mateusz Jablonski 292f16d423 Remove handling of DATA_PARAMETER_LOCAL_ID_BUFFER
Related-To: NEO-5081, IGC-4710
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2022-02-24 15:14:06 +01:00
Kacper Nowak 447c40cec0 Fix generating localIDs in zebin
This commit fixes generating localIDs in zebin.
With thix fix, Emit Local in compute walker will be set accordingly with
the size of local_id argtype (currently, Emit Local is set to Emit None,
which prevents generating local IDs).

Related-To: NEO-6089
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2022-02-23 16:51:55 +01:00
Katarzyna Cencelewska 7d2d5e5792 Add to decodeToken debugPrintf when ignored token
set as ignored token PATCH_TOKEN_INTERFACE_DESCRIPTOR_DATA

Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com>
2022-02-23 13:37:05 +01:00
Mateusz Jablonski 8860fcc868 Handle patch token for implicit args buffer
Related-To: NEO-5081, IGC-4710
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2022-02-23 12:04:54 +01:00
Compute-Runtime-Validation faba32daf0 Revert "Fix generating localIDs in zebin"
This reverts commit 441fe1f589.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2022-02-23 06:33:33 +01:00
Katarzyna Cencelewska 4994eb18c2 Remove device side enqueue info from kernel descriptor
Related-To: NEO-6559
Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com>
2022-02-22 14:18:44 +01:00
Kacper Nowak 441fe1f589 Fix generating localIDs in zebin
This commit fixes generating localIDs in zebin.
With thix fix, Emit Local in compute walker will be set accordingly with
the size of local_id argtype (currently, Emit Local is set to Emit None,
which prevents generating local IDs).

Related-To: NEO-6089
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2022-02-21 18:20:05 +01:00
Kacper Nowak cd9cc53159 Correct setting usesStringMap flag in printf
This commit fixes setting usesStringMap flag for printf, taking into
account using indirect functions in legacy (non-zebinary) path. It also
adds new field to kernelDescriptor, specifying the binary type
(legacy/zebin).

Related-To: NEO-6604
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2022-02-15 15:39:10 +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
Krystian Chmielewski d49c5d6185 OCL: Set target device product family
In OCL product family of target device is not set
which leads to a fail on validating target device in
ZEBin path.
This change adds function that sets all
necessary fields based on provided hardware info.

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2022-02-08 16:49:28 +01:00
Compute-Runtime-Validation 6f62a784e1 Revert "Check IndirectStatelessCount from igc"
This reverts commit 5e62df4f8e.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2022-02-04 12:15:37 +01:00
Dominik Dabek 5e62df4f8e Check IndirectStatelessCount from igc
If kernel has no stateless indirect accesses don't set the
kernelHasIndirectAccess flag.
Don't make resident or migrate if kernel has no indirect accesses.
Changed initial values in KernelAttributes.

Related-To: NEO-6597

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2022-02-02 12:28:30 +01:00
Dominik Dabek 07c75c2de3 Revert "Check IndirectStatelessCount from igc"
This reverts commit 01f368ac147d99fd0dcb4d71a9a2543cd215adfd.

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2022-01-27 16:06:13 +01:00
Igor Venevtsev af7a475cb0 Fix debug zebin creation
- ELF type is EXEC
- Absolute GPU addresses in program headers as load addresses
- All relocations are applied (not only for debug info as before)
- Default section alignment for debug zebin is set to 4,
this fix the problem with .notes section parsing

Related-To: NEO-5571
Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
2022-01-26 13:55:32 +01:00
Dominik Dabek 63f406a58c Check IndirectStatelessCount from igc
If kernel has no stateless indirect accesses don't set the
kernelHasIndirectAccess flag.
Don't make resident or migrate if kernel has no indirect accesses.
Changed initial values in KernelAttributes.

Related-To: NEO-6597

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2022-01-26 11:10:04 +01:00
Katarzyna Cencelewska 20f17f775e Remove device enqueue part 8
- remove hasDeviceEnqueue

Related-To: NEO-6559
Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com>
2022-01-19 11:16:35 +01:00
Kacper Nowak fc224202d6 Create debug zebin in OCL
This commit adds debug zebin creation in OCL.
- Added returning debug zebin in build/linking paths in OCL if
corresponding device binary format was detected.
- Refactored getZebinSegments() method - added common ctor for both
L0/OCL paths

Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2022-01-17 14:27:23 +01:00
Krystian Chmielewski 79c8605ed2 Fix checking required DSH Size
This change simplifies calculating required DSH Size
and replaces wrong debug break conditiong causing
debug assertion fails in many tests with simple
check "calculatedDSHSize > allocatedDSHSize".

Related-To: NEO-6077

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2022-01-15 00:24:46 +01:00
Krystian Chmielewski 325ae63d05 Sort program headers by virt addr
When encoding ELF binary sort program headers by
virtual addresses incrementally.
This change is needed for compatibility with GDB.

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2022-01-11 13:23:59 +01:00
Krystian Chmielewski 9d5907c8d0 Debug zebin copy section header's flags
When creating debug ZEBinary copy section header's flags
from ZEBinary to debug binary.

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-12-17 21:01:18 +01:00
Kacper Nowak 1c74eca1ae Add source offset entry for arg by value in zebin
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2021-12-17 16:45:49 +01:00
Jim Snow 2dfb7df63b Add RTDispatchGlobals allocation for ray tracing
If a kernel has ray tracing calls, we allocate and initialize
per-device RTDispatchGlobals if needed, and hand off pointer to
the same into a running kernel via an implicit parameter.

Related-To: NEO-5384
Signed-off-by: Jim Snow <jim.m.snow@intel.com>
2021-12-08 09:44:13 +01:00