Commit Graph

93 Commits

Author SHA1 Message Date
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
c8e60ce3ba Support Circular and chained deps in L0 Dynamic Link
- Added support for Dynamic Module link to allow usage of
symbols that exist thru a circular dependency from the export->import
module & chained dependencies with importModule -> ExportModule ->
ExportModule2.

- Adds a dependency walker which collects all dependent modules whose
export surface state must be made resident for a given kernel
execution to successfully access each function resolved on different
modules.

- Expanded the Dynamic Link Black Box test to allow for testing either
simple linking and circular + chained linkage.

Signed-off-by: Spruit, Neil R <neil.r.spruit@intel.com>
2022-03-11 21:15:08 +01:00
3e8a6680e2 Allow undefined symbols in symbol table for OCL
Related-To: NEO-5081
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2022-03-09 10:32:15 +01:00
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
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
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
be7c45bab0 Fix registering and unregistering module debug handle
- do not unregister module handle if not registered before

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2022-02-18 08:43:15 +01:00
0e37f8c830 Register zebin module for all kernel allocations
Related-To: NEO-6637

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2022-02-15 16:58:04 +01:00
c5c3e865f0 Revert "Fail build program on PVC with stateful accesses"
This reverts commit 9466113cef.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2022-02-14 18:55:14 +01:00
9466113cef Fail build program on PVC with stateful accesses
Related-To: NEO-6075

After this change driver will fail clBuildProgram/zeModuleCreate api calls
whenever stateful access is discovered on PVC.
This is required since in this case allocation greater than 4GB
will not work.
If user still wants to use stateful addressing mode,
-cl-opt-smaller-than-4GB-buffers-only / -ze-opt-smaller-than-4GB-buffers-only
build option should be passed as build option, but then user can not use
bufers greater than 4GB.


Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
2022-02-14 13:44:22 +01:00
e1758a2206 Register ELF for every kernel allocation for zebin format
- every isa allocation will have ELF linked
- fix for debug elf from patchtoken binary:
pass relocated ELF when exists
- simplify code

Related-To: NEO-5571

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2022-02-08 17:33:53 +01:00
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
ad7f2f1f6e Notify kernel loads after copying fully linked ISA
- notify through make resident call

Related-To: NEO-6556

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2022-01-21 14:28:22 +01:00
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
79bf9401ef Fallback to buildFromSpirV given < 2 static link targets
Signed-off-by: Neil R Spruit <neil.r.spruit@intel.com>
2022-01-14 02:17:52 +01:00
71746a2fff Register zebin binary in L0 debugger
Related-To: NEO-5571

Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
2022-01-12 23:17:59 +01:00
3599e7aeda Add warning when device binary had to be recompiled
Introduced a new warning, which is printed to build log, when the
binary needs to be recompiled. Added a new flag -Wno-recompiled-from-ir
to allow suppression of that message. Removed a bug related to memcpy_s
from ModuleBuildLogImp::getString() and aligned it with specification.

Related-To: NEO-5819
Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
2021-12-23 16:13:59 +01:00
17f82bbe12 Fix double ISA transfer for user kernels in L0
Related-To: NEO-6555

- ISA should only be copied once, after linking phase is complete

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2021-12-21 07:54:51 +01:00
80ed37faf6 Return debug ZeBin on getDebugInfo in Level Zero
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2021-12-14 16:29:42 +01:00
7e08e56d50 Zebin: allow undef symbols
Skip undefined symbols when decoding ELF symbol table
instead of treating them as error in zebin path in
order to support dynamic linking scenarios.

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-12-13 15:31:56 +01:00
b7cee61bde Revert "Fail build program in shared system USM + stateful access case"
This reverts commit 0ad8afc0b3.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2021-12-07 01:00:59 +01:00
0ad8afc0b3 Fail build program in shared system USM + stateful access case
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
Related-To: NEO-6075

After this change driver will fail clBuildProgram/zeModuleCreate api calls
whenever stateful access is discovered and device has shared system usm caps
enabled.This is required since in this case allocation greater than 4GB
will not work.
If user still wants to use stateful addressing mode,
-cl-opt-smaller-than-4GB-buffers-only / -ze-opt-smaller-than-4GB-buffers-only
build option should be passed as build option, but then user can not use
buffers greater than 4GB.
2021-12-06 15:10:16 +01:00
b11d7cd7b0 Add debug key for compiler internal options injection
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2021-11-23 15:41:11 +01:00
8e57e48695 L0: Pass debug zebin to SLD
Added passing debug zebin to SLD.
Added support for .const.data.strings section in debug zebin creation.
Refactored debug zebin creation code.

Resolves: NEO-6246
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-11-18 11:38:23 +01:00
75a5aed81d Refactor patching implicit args relocation
Related-To: NEO-5081
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2021-11-15 17:09:36 +01:00
d29148a73a Populate linkerInput before allocating globals
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-11-09 12:20:13 +01:00
06eaef0352 Zebin: Use strings section for printf
Resolves: NEO-6143

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-11-07 19:10:47 +01:00
38eab0e70f Return correct status when module is not fully linked
Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
2021-10-13 16:18:42 +02:00
12ab2961b1 L0 support for SPIRv static module linking
Signed-off-by: Spruit, Neil R <neil.r.spruit@intel.com>
2021-10-05 07:09:53 +02:00
25c71a6c13 Move kernel info to shared directory
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
2021-09-29 23:49:49 +02:00
e7a7a61b4e Revert "L0 support for SPIRv static module linking"
This reverts commit 479035c839.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2021-09-24 05:47:50 +02:00
479035c839 L0 support for SPIRv static module linking
Signed-off-by: Spruit, Neil R <neil.r.spruit@intel.com>
2021-09-22 23:38:50 +02:00
0d1c8be447 Handle implicit arg relocation in L0 module
Related-To: NEO-5081
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2021-09-14 08:57:10 +02:00
30f411de44 Make allocation writable for TBX and AUB when patching ISA
Related-To: NEO-5081
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2021-09-08 10:51:41 +02:00
3389c452c7 Added Link Log for L0 Dynamic Module Linking
Signed-off-by: Spruit, Neil R <neil.r.spruit@intel.com>
2021-08-24 07:19:23 +02:00
d119494854 L0 Support for Dynamic Module Linking for undefined symbols
- Support for L0 apps to handle undefined symbols reported by IGC
- Removed duplication of symbol in exported symbol list and relocation
for properly resolving the symbol during dynamic link
- Add export module's exported function surface state to the import
module's residency container during dynamic linkage to allow import
kernels to execute exported functions.

Signed-off-by: Spruit, Neil R <neil.r.spruit@intel.com>
2021-08-13 19:26:41 +02:00
5d49dedf00 Revert "L0 Support for Dynamic Module Linking for undefined symbols"
This reverts commit e602f4829d.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2021-08-13 10:33:13 +02:00
e602f4829d L0 Support for Dynamic Module Linking for undefined symbols
- Support for L0 apps to handle undefined symbols reported by IGC
- Removed duplication of symbol in exported symbol list and relocation
for properly resolving the symbol during dynamic link
- Add export module's exported function surface state to the import
module's residency container during dynamic linkage to allow import
kernels to execute exported functions.

Signed-off-by: Spruit, Neil R <neil.r.spruit@intel.com>
2021-08-12 21:30:13 +02:00
7c6c45f5b5 Add option to allocate private mem per dispatch
Signed-off-by: Jaroslaw Chodor <jaroslaw.chodor@intel.com>
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-07-27 13:34:12 +02:00
4ba64d2530 Add ze-opt-level support
Related-To: LOCI-2315
Signed-off-by: Young Jin Yoon <young.jin.yoon@intel.com>
2021-07-20 20:34:57 +02:00
1b2cfbbb1f Align per thread data size to GRF size
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-07-15 11:53:13 +02:00
7c8fcb30ed Module: Force stateless compilation if system shared allocations allowed
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
2021-06-29 13:54:40 +02:00
3bd4bca911 Copyright header update
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>
2021-05-17 20:38:19 +02:00
8fd65cc6bf Do not append debugKernelEnable internal option
- module compilation does not need it when L0 debugger used

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2021-05-11 08:20:22 +02:00
ef71915c71 Remove KernelArgInfo and use KernelDescriptor's args instead
Related-To: NEO-4729
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-04-23 15:12:09 +02:00
ffc310858a Add DebugVariable to control opt-disable when debugger is used
Resolves: NEO-5760

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2021-04-19 16:41:14 +02:00
0897f997d6 Fix zeModuleGetGlobalPointer()
- return size correctly
- check if pSize and pPtr is != nullptr

Resolves: NEO-5641

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2021-03-18 17:29:41 +01:00
c1cabb505a Fix Get ConstSpecSize based on correlated ConstSpecID
Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
2021-03-02 12:11:08 +01:00
c0268abc26 Revert "Take spec const value sizes from compiler"
This reverts commit da3805880b.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2021-02-26 16:22:10 +01:00
da3805880b Take spec const value sizes from compiler
Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
2021-02-25 10:42:21 +01:00