Commit Graph

243 Commits

Author SHA1 Message Date
Patryk Wrobel c0342a0ab5 Optimize binaries' size by adjusting linkage of constants in headers
When header is included for the first time in translation unit,
then preprocessor simply copy-pastes its content. If we define a
constant in a header file and this constant has internal linkage
then each and every translation unit, which includes this header
will have its own copy of this constant.

C++17 introduces inline variables, which are meant to allow creation
of variables in header files, which do not cause multiple instances.

The inline variable has a single instance when:
- constexpr is used without static (constexpr implicitly implies inline)
- inline is used without static
- inline const is used without static (const does not imply internal linkage
when used with inline)

Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
2022-08-26 22:52:04 +02:00
Compute-Runtime-Validation 7319d05469 Revert "feat(zebin): set missing pointer size for arg type buffer address"
This reverts commit cc17c53a77.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2022-08-19 06:54:59 +02:00
Kacper Nowak cc17c53a77 feat(zebin): set missing pointer size for arg type buffer address
Set missing pointer size for argument type buffer address in zebin.
This PR is related to test failures after merging corresponding IGC
change.

Related-To: IGC-5486
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2022-08-18 20:37:24 +02:00
Krystian Chmielewski 18adbed233 feat(zebin): add thread scheduling mode support
Resolves: NEO-7197

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2022-08-18 16:10:18 +02:00
Krystian Chmielewski 70ef88c0bb feat(zebin): add sampler metadata support
This commit adds support for sampler's metadata in zebinary and
updates some image's metadata field names.

Resolves: NEO-7257

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2022-08-16 10:11:01 +02:00
Patryk Wrobel 44e1f1ba4b Remove redundant copying of std::vectors
Usage of initializer list in for loop to iterate over heavy types
has bad consequences. std::initialize_list is only a view and its
data is silently created as T[N]. Therefore, if someone uses
std::vector with it, it will cause deep-copying of the elements.

This change introduces usage of pointers on std::initializer_list
to perform a shallow-copy of an addresses. Furthermore, it adds
const references in few places, where copy is not needed.

Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
2022-08-16 09:27:16 +02:00
Krystian Chmielewski 9bd2c7da2b refactor(zebin decoder): parsing enums
This commit simplifies parsing of enums in zebin decoder and removes
unnecessary tests.

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2022-08-10 23:36:25 +02:00
Kacper Nowak f219617823 Zebin: Do not fail on parsing unrecognized intelGT note types
When an IntelGT note type is not recognized, skip it instead of
returning negative target device validating result.
Related-To: NEO-7190
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2022-08-10 17:04:22 +02:00
Krystian Chmielewski eecde9114a feat(zebin): add image metadata support
This commit adds support of image metadata in zebin format.

Resolves: NEO-7251

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2022-08-10 00:06:51 +02:00
Kacper Nowak f774deffa7 Zebin: ZEBinary ELF versioning in intelNoteGT section
This commit adds support for new ZEBinary ELF versioning mechanism.
- Add new IntelGTSecionType: ZebinVersion
- Add mechanism for retrieving zeInfo/elf version in intel.notegt
section
Related-To: NEO-7190
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2022-08-09 17:58:12 +02:00
Kamil Kopryk d4d54f5093 Cleanup includes
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
2022-07-25 09:58:38 +02:00
Kacper Nowak 843227962a Update ZEInfo version to 1.9
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2022-07-22 13:24:33 +02:00
Jim Snow f4879f064f Allocate per-tile RTDispatchGlobals, handle ray tracing patch tokens.
Related-to: NEO-6711

Signed-off-by: Raiyan Latif <raiyan.latif@intel.com>
2022-07-22 06:29:29 +02:00
Compute-Runtime-Validation 0eb2001d8f Revert "Check indirect access from igc"
This reverts commit e5d63cd303.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2022-07-22 04:39:16 +02:00
Dominik Dabek e5d63cd303 Check indirect access from igc
Also add workaround for app passing svm pointers by value

Related-To: NEO-7182

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2022-07-21 12:25:24 +02:00
Kacper Nowak 0a4ab48e0b Zebin: Remove actual_kernel_start_offset from execEnv
This change is needed to bump zeInfo version beyond 1.6
- Version 1.6: Remove actual_kernel_start_offset from execution environment.

Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2022-07-20 11:24:28 +02:00
Kacper Nowak 3a446e75cf Yaml parser: reserve additional space for nesting + simplify reserving logic
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2022-07-19 16:34:39 +02:00
Compute-Runtime-Validation f9888db0fb Revert "Check indirect access from igc"
This reverts commit e14c91fa6c.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2022-07-16 07:36:49 +02:00
Dominik Dabek e14c91fa6c Check indirect access from igc
Related-To: NEO-7182

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2022-07-15 15:01:48 +02:00
Warchulski, Jaroslaw 4147f40970 DisableKernelRecompilation flag and binary kernel recompilation warning
Resolves: NEO-6513
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2022-07-14 18:22:49 +02:00
Kacper Nowak 8a6d6dd449 Yaml parser: remove unnecessary container size manipulation
This commit removes unnecessary container size manipulation in yaml
parser. Space reservation is done by dedicated function
reserveBasedOnEstimates, so there is no need to manually resize the
container's size afterwards.
- Ensure that no invalidated iterators/references are used.
- Use push_back() instead of resize(...size()+1).
- Use reserveBasedOnEstimates() instead of reserve(...size()+1)
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2022-07-12 17:38:06 +02:00
Katarzyna Cencelewska 25ce4d0c04 Clean unused code
remove parts with device queue

Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com>
2022-07-07 14:52:26 +02:00
Daria Hinz 5745c3d99d Change AOT enums type & use forward declaration
Signed-off-by: Daria Hinz <daria.hinz@intel.com>
2022-06-20 13:40:29 +02:00
Nowak, Kacper b3d94add4b Set missing field for buffer_address kernel arg type
Set missing pointerSize (basing on source size field) for buffer_address arg
type.
Signed-off-by: Nowak, Kacper <kacper.nowak@intel.com>
Related-To: NEO-7048
2022-06-15 16:49:11 +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
Krystian Chmielewski adfc3a1e7a feat(dbg zebin): set sym value to absolute address
GDB requires debug zebin to be an absolute ELF. This change adds setting
symbols values to absolute addresses allowing GDB to work correctly.

Resolves: NEO-7097

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2022-06-13 12:40:44 +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 de75e51228 Zebin: Add support for new buffer_address arg type
This change adds support for new "buffer_address" arg type, which adds
buffer address information for stateful-only argument. This will prevent
from generating stateless version of a kernel argument if all its
accesses are to be promoted to the stateful ones.
- Change default value of accessedUsingStatelessAddressingMode flag.

Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
Related-To: NEO-7048
2022-06-08 17:33:31 +02:00
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
Krystian Chmielewski 10acf9488b Zebin: accept .visaasm sections
Related-To:NEO-6456

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-12-03 14:03:48 +01:00
Kacper Nowak 2c3a1bf460 Make calcualting explicitArgs number independent of payloadArgs size
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2021-11-26 14:05:40 +01:00
Krystian Chmielewski 6519aa1822 ZEbin: add inline_data_payload_size field
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-11-23 11:22:04 +01:00
Krystian Chmielewski 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
Mateusz Jablonski ec89b4eae7 Consume HasStackCalls info from IGC
Related-To: NEO-5081
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2021-11-15 20:30:51 +01:00
Krystian Chmielewski 620484010d Zebin: Add test for default execEnv values
Added test checking population of Kernel Descriptor with default
execution environment values.
Sorting.

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-11-10 17:36:25 +01:00
Krystian Chmielewski 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
Compute-Runtime-Validation 870b324d72 Revert "ZEBin: fix CTD passing when inline data is supported"
This reverts commit 125946e374.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2021-11-05 13:31:50 +01:00
Krystian Chmielewski 125946e374 ZEBin: fix CTD passing when inline data is supported
In zebin always pass inline data when it's supported.

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-11-05 10:04:19 +01:00
Krystian Chmielewski bb77165f70 remove regex from yaml parser
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-10-29 15:11:48 +02:00
Krystian Chmielewski f20cdac7d3 Zebin: add support for has_dpas
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-10-28 09:59:21 +02:00
Krystian Chmielewski f164acad0b Allow whitespace before ] in inline collection
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-10-27 15:32:32 +02:00
Krystian Chmielewski 174c1dfe64 Add inline collection support in yaml parser
Added support for inline collection in following syntax: [1, 2, 3]

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-10-27 13:23:13 +02:00
Kamil Kopryk 3a52858529 Remove not needed fallthrough
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
2021-10-25 15:30:22 +02:00
Bartosz Dunajski d34ef3170a Remove CPP_ATTRIBUTE_FALLTHROUGH macro
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
2021-10-22 17:27:57 +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
Artur Harasimiuk a63b9b1273 move common files to shared/
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
2021-09-27 11:10:20 +02:00
Krystian Chmielewski 1417e894c7 Create debug zebin
Creates copy of zebinary with program headers containing
addresses of segments and applies debug relocations.


Related-To: NEO-6071
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-09-15 13:56:38 +02:00
Krystian Chmielewski 03e29c34c4 Decode debug environment - zebin
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-09-15 10:10:04 +02:00
Jaroslaw Chodor c23a74e902 Zebin - optimizing yaml parser
Signed-off-by: Jaroslaw Chodor <jaroslaw.chodor@intel.com>
2021-08-05 14:05:53 +02:00
Krystian Chmielewski 7dea397f22 Decode collection attributes in exec env
Add support for decoding required work group size and work gorup walk
order dimensions in zebin.

Related-To: NEO-6088
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-07-27 14:09:30 +02:00
Krystian Chmielewski 78abc1c6fd Add work dimensions payload arg to zebin
Related-To: NEO-5833
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-07-20 16:30:27 +02:00
Krystian Chmielewski 9c7d8a183b Decode zebin reloc types
Change LinkerInput::RelocationInfo::Type to be compliant with zebin
relocation types.
Add support for setting relocation type if zebin relocation
type is set.
Continue supporting R_AMD64_64 and R_AMD64_32 relocation types for
backward compatibility

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-07-16 12:33:51 +02:00
Jaroslaw Chodor 6bac487e32 Accepting all debug section in zebin
Signed-off-by: Jaroslaw Chodor <jaroslaw.chodor@intel.com>
2021-07-15 18:11:07 +02:00
Krystian Chmielewski a32c022202 Accept debugInfo section in zebin
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-07-15 12:50:48 +02:00
Krystian Chmielewski 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
Krystian Chmielewski 7ee83db9d8 Add support for IntelGT note section
Add extraction of IntelGT note section in zebin decoder.
Add target validation based on intelGT notes in zebin decoder.
Add check in unpacking (unpackSingleDeviceBinary) for e_machine,
and validate target device accordingly.

Related-To: NEO-5658
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-07-09 11:17:14 +02:00
Jaroslaw Chodor 84653008b9 Fatbinary - settle for IR if devbin not available
Fixes problems with recompilation from IR when
fatbinary is being used.

Signed-off-by: Jaroslaw Chodor <jaroslaw.chodor@intel.com>
2021-06-28 17:09:09 +02:00
Krystian Chmielewski 8a2e8670a7 Update zeInfo decoder version
Related-To: NEO-3739
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-06-23 14:08:40 +02:00
Krystian Chmielewski d62049035a printf support with ZEBinary
Resolves: NEO-5657

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-06-21 20:53:58 +02:00
Krystian Chmielewski c94ad034d9 Add support for zebin sampler_index
Resolves: NEO-5823
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-05-20 14:40:46 +02:00
lgotszal 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
Krystian Chmielewski 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
Konstanty Misiak 0dc2143dea Fix zebin kernel without explicit arguments decoding
Related-To: NEO-5562

Signed-off-by: Konstanty Misiak <konstanty.misiak@intel.com>
2021-03-22 12:06:26 +01:00
Krystian Chmielewski 10af36c70a Add support for buffer_offset arg
Resolves: NEO-5487

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-03-18 12:29:27 +01:00
Filip Hazubski 9a8125cdb0 Correct formatting
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
2021-03-16 10:29:41 +01:00
Krystian Chmielewski 41f3bd00ff Remove PatchTokens from KernelInfo
Use KernelDescriptor instead of patchTokens stored in KernelInfo's
patchInfo.
Removed: SPatchMediaInterfaceDescriptorLoad, SPatchAllocateLocalSurface,
SPatchMediaVFEState(slot 0), SPatchMediaVFEState(slot 1),
SPatchInterfaceDescriptorData, SPatchSamplerStateArray,
SPatchBindingTableState, SPatchDataParameterBuffer,
SPatchDataParameterStream, SPatchThreadPayload,
SPatchKernelAttributesInfo, SPatchAllocateStatelessPrivateSurface,
SPatchAllocateSyncBuffer,
SPatchAllocateStatelessConstantMemorySurfaceWithInitialization,
SPatchAllocateStatelessGlobalMemorySurfaceWithInitialization,
SPatchAllocateSystemThreadSurface.

Related-To: NEO-4729
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-03-09 17:09:13 +01:00
Mateusz Hoppe 6dd0f0c728 Relocate debug data
Related-To: NEO-4769

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2021-02-16 14:59:30 +01:00
Jaime Arteaga 1aca16a7ac Add experimental_properties for indirect access
Read zebin experimental properties indicating whether a kernel has
indirect access and if so, ignore calls to zeKernelSetIndirectAccess.

Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
2021-02-10 14:23:43 +01:00
Mateusz Hoppe 5d2ea72db6 Handle relocations from zeBin
Related-To: NEO-5323

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2021-01-21 13:16:38 +01:00
Jaroslaw Chodor 4c50a9e147 Zebin - Improving binding table generation
Allowing N:1 kernel_arg:bti mappings

Signed-off-by: Jaroslaw Chodor <jaroslaw.chodor@intel.com>
2021-01-20 18:37:45 +01:00
Mateusz Hoppe ffb6e955b1 Decode relocations in ELF
Related-To: NEO-4769, NEO-5323

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2021-01-19 16:02:25 +01:00
Mateusz Jablonski 5a5ad64f5d Ocloc compile: support gen families exposed in help
fix typo in method name

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2021-01-11 19:11:56 +01:00
Krystian Chmielewski 4948c39d39 Remove executionEnvironment from KernelInfo
Related-To: NEO-3739
2020-12-16 14:56:57 +01:00
Kamil Diedrich 79d4af28de Switch to c++17
Signed-off-by: Kamil Diedrich <kamil.diedrich@intel.com>
2020-12-03 15:15:32 +01:00
Jaroslaw Chodor 0e9be40a7c zebin - fixing missing image metadata
Change-Id: Iae49aacb2fb7b38eea987a5fb283f12fc75718bf
2020-11-02 14:10:49 +01:00
Jaroslaw Chodor 345e56a151 Zebin improvements
* cleaning-up per-thread buffer size calculations
* fixing default slm alignment to 16
* adding scratch space slots
* renaming slm addressing mode
* adding support for zeinfo version

Change-Id: I0450353788b8488a685976d7f1dd26a44360383c
2020-10-29 16:33:21 +01:00
Bartosz Dunajski 1926ef8319 is_simt_thread token support
Change-Id: I8cee6ff26229f0f492ba0d1e5e61d6e46e0c2486
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
2020-10-21 14:14:43 +02:00
Konstanty Misiak ec054a87da Fix builtin compiling with ZEBin
Related-To: NEO-5020

Change-Id: I2698db921e8b6c61ee592a0d6611dc38173a1688
Signed-off-by: Konstanty Misiak <konstanty.misiak@intel.com>
2020-10-06 13:04:45 +02:00
Bartosz Dunajski 55bd544402 Lazy evaluate arguments of printDebugStrings(...) function
Change-Id: Ie44e109fd9235c5df32fb90b9e6fc6058e558a99
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
2020-09-25 18:38:58 +02:00
Jaroslaw Chodor a4ba92338a zebin - strip kernel name of quotes
Change-Id: If8054c01ea1992c0ba998e22b726b127c652beed
2020-09-07 18:25:36 +02:00
Jaroslaw Chodor 2d4468bb3b Ignore SHT_ZEBIN_GTPIN_INFO
Change-Id: I85c5bd52d96dce6603329bfe997a70dc5a432d3f
2020-09-07 18:04:37 +02:00
Jaroslaw Chodor 36d350c8fc Zebin per_thread_memory_buffers
Change-Id: I66074ac9f1d5b1417dfad5c044149e86ab9aad1d
2020-08-31 15:09:49 +02:00
Jaroslaw Chodor 2a41911166 Updating zeinfo decoder
Change-Id: Ib07b58e628e866af6e5368c6856dc9ebf0985aa7
2020-08-19 17:15:31 +02:00
Pawel Cieslak fb821f21f5 Cmake format script
Related-To: NEO-1157

Change-Id: Ie1b907e838cfb9ad0d75cc8971d415f7c77103c9
Signed-off-by: Pawel Cieslak <pawel.cieslak@intel.com>
2020-08-19 16:36:30 +02:00
Jaroslaw Chodor 51d00dbc47 ocloc zebin validator
Change-Id: I56bd384a0af4f3460a41850bf178c4163b812221
2020-08-13 14:17:39 +02:00
Jaroslaw Chodor 321f649854 Zebin support
Change-Id: I1e426ee2c5174fd0a4c51c1644cda467c2b88881
2020-08-07 11:48:41 +02:00
Jaroslaw Chodor d65cdab453 Zebin - yaml parser
Change-Id: If8b5bcd68b7d39bfd3fb53b619f5de973b059bff
2020-07-30 07:26:44 +02:00
Pawel Cieslak f184d79325 Fix clang-10 runtime error: applying non-zero offset to null pointer
Change-Id: Ib53d7eb39378875287442b0776bf47760b041083
Signed-off-by: Pawel Cieslak <pawel.cieslak@intel.com>
2020-04-08 19:08:20 +02:00
Jaroslaw Chodor 7fc44aa60e Support for clLink with spec constants
Resolves: NEO-4537

Change-Id: Ic9a9ea8a7d4a83e6a308735b653bdd334cb88bf9
Signed-off-by: Jaroslaw Chodor <jaroslaw.chodor@intel.com>
2020-04-03 00:21:33 +02:00
Jaroslaw Chodor 915b80b1df Introducing kernel descriptor
Change-Id: I4ce6ebf27a81cf14b055817ebfe76d8427e349ab
2020-02-25 00:03:15 +01:00
Mateusz Jablonski 9dbeeea18f Clang-format: restore sorting includes
Change-Id: I34eb993b562c77f56d8fbd51a02ee266c1f76678
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2020-02-24 10:22:30 +01:00
Mateusz Jablonski 7df9945ebe Add absolute include paths
Change-Id: I67a6919bbbff1d30c7d6cdb257b41c87bad51e7f
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2020-02-23 23:49:12 +01:00
kamdiedrich e072275ae6 Reorganization directory structure [3/n]
Change-Id: If3dfa3f6007f8810a6a1ae1a4f0c7da38544648d
2020-02-23 23:48:28 +01:00