Commit Graph

215 Commits

Author SHA1 Message Date
Compute-Runtime-Validation 1395a2cb38 Revert "refactor: linux cl_cache eviction mechanism"
This reverts commit a02ac1c140.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2023-11-28 08:51:36 +01:00
Fabian Zwolinski a02ac1c140 refactor: linux cl_cache eviction mechanism
Refactored eviction mechanism works as follows:
- eviction is needed only if
total size of cache binaries + size of the new binary exceed cache limit
- single evition call removes files with a summed size of 1/3 of the cache limit
- if new binary can not fit in the cache size limit
even after eviction, it will not be saved
- cache limit applies only to
files in cache directory with .cl_cache/.l0_cache extension.
Only these files are counted and only these files are removed

Minor:
- rename variables for better readability
- add `const` where possible

Related-To: NEO-4262
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-11-27 18:20:41 +01:00
Compute-Runtime-Validation a8d404f859 Revert "refactor: linux cl_cache eviction mechanism"
This reverts commit 2aa0ae0eca.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2023-11-18 01:13:12 +01:00
Fabian Zwolinski 2aa0ae0eca refactor: linux cl_cache eviction mechanism
Refactored eviction mechanism works as follows:
- eviction is needed only if
total size of cache binaries + size of the new binary exceed cache limit
- single evition call removes files with a summed size of 1/3 of the cache limit
- if new binary can not fit in the cache size limit
even after eviction, it will not be saved
- cache limit applies only to
files in cache directory with .cl_cache/.l0_cache extension.
Only these files are counted and only these files are removed

Minor:
- rename variables for better readability
- add `const` where possible

Related-To: NEO-4262
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-11-17 09:48:42 +01:00
Mateusz Jablonski 330fb40107 fix: fix clang-tidy issues
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-10-31 16:32:06 +01:00
Jablonski, Mateusz ac5f64f5c6 fix: fix compilation error in clang on Windows (2/n)
Signed-off-by: Jablonski, Mateusz <mateusz.jablonski@intel.com>
2023-10-24 15:59:06 +02:00
Fabian Zwolinski d7d577ba48 feature: enable cl_cache by default on Windows
Related-To: NEO-8092
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-10-03 16:57:10 +02:00
Fabian Zwolinski 1f1af5bb36 refactor: windows cl_cache eviction mechanism
Refactored eviction mechanism works as follows:
- eviction is needed only if
total size of cache binaries + size of the new binary exceed cache limit
- single evition call removes files with a summed size of 1/3 of the cache limit
- if new binary can not fit in the cache size limit
even after eviction, it will not be saved
- cache limit applies only to
files in cache directory with .cl_cache/.l0_cache extension.
Only these files are counted and only these files are removed

Related-To: NEO-8092
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-10-03 16:20:28 +02:00
Fabian Zwolinski 7c80f49176 fix: refactor Windows cl_cache and add extra safety layers
What's changed:
- Add early return when open existing config
fails due to different error than `ERROR_FILE_NOT_FOUND`
- Swich `ReadFileEx` to `ReadFile`
- Add `SetFilePointer` to make sure we're reading
from the beginning of the file
- Pass `overlapped` to `WriteFile` to make sure
we're writing from the beginning of the file

Related-To: NEO-8092
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-10-02 19:04:14 +02:00
Compute-Runtime-Validation 65337482ff Revert "feature: enable cl_cache by default on Windows"
This reverts commit e16220dc9f.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2023-09-26 15:06:34 +02:00
Fabian Zwolinski e16220dc9f feature: enable cl_cache by default on Windows
Related-To: NEO-8092
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-09-25 14:40:43 +02:00
Fabian Zwolinski 5881b97db2 fix: cl_cache windows - delete incorrectly created config.file
config.file should not be created manually by the user.
In a scenaro when the user manually creates an empty config.file,
then reading data from this file ends with failure,
because the file is empty.
Such scenario completely freezes the cache creation
until the user manually deletes the empty config file.
This patch fixes such freeze by automatically deleting config
if read fails with ERROR_HANDLE_EOF error.
Patch applies to windows only.

Related-To: NEO-8092
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-09-22 13:27:25 +02:00
Fabian Zwolinski f931c25307 fix: add missing file handle close
Related-To: NEO-8092
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-09-21 16:50:16 +02:00
Fabian Zwolinski e96dd344c3 feature: add new environment variables for compiler cache on Windows
Changes:
- replaced registry keys with environment variables
for cl_cache in OCL
- added compiler cache helpers
- implemented support for new env vars on Windows
- added tests

New env vars mechanism works as follows:
If `PERSISTENT_CACHE` is set,
driver checks if `NEO_CACHE_DIR` is set.
If `NEO_CACHE_DIR` is not set,
driver uses `%LocalAppData%\NEO\neo_compiler_cache`
as `cl_cache` destination folder.
If `NEO_CACHE_DIR` is not set and `%LocalAppData%`
path could not be obtained,
compiler cache is disabled.

In the current Windows implementation,
special characters in the folder path are not supported.

Related-To: NEO-8092
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-09-21 12:40:48 +02:00
Mateusz Jablonski 698a3ed3de fix: correct adjusting hw info for IGC, cover all cases
Related-To: NEO-8203

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-09-19 15:23:18 +02:00
Compute-Runtime-Validation f8cae41e70 Revert "fix: correct adjusting hw info for IGC, cover all cases"
This reverts commit a75fcb6de0.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2023-09-19 02:53:33 +02:00
Mateusz Jablonski a75fcb6de0 fix: correct adjusting hw info for IGC, cover all cases
Related-To: NEO-8203
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-09-18 13:50:32 +02:00
Fabian Zwolinski 0538f0524a refactor: make os_handle.h non os specific
Use the same file `os_handle.h` on both
Linux and Windows.
Change implementation of `HandleType` -> `UnifiedHandle` to
`std::variant<int, void *>`
use `int` on Linux
use `void *` on Windows

Related-To: NEO-8092
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-09-15 15:53:41 +02:00
Fabian Zwolinski 10675134e1 feature: Add process safety to Windows compiler cache
Related-To: NEO-8092

Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
Co-authored-by: Diedrich, Kamil <kamil.diedrich@intel.com>
2023-09-06 15:34:15 +02:00
Naklicki, Mateusz ff57bec1f0 fix: ignore subDeviceId token instead of skipping builtins resolve
Previous implementation skipped resolving the subDeviceId token, which
caused in returning the LinkedPartially status if token was present.
It could result in ZE_RESULT_ERROR_INVALID_MODULE_UNLINKED when kernel
was created and crashing an app.

Related-To: NEO-6875, HSD-14015133115
Signed-off-by: Naklicki, Mateusz <mateusz.naklicki@intel.com>
2023-09-05 16:26:44 +02:00
Kacper Kasper abfed5a762 fix: add specialization constants to cache hash in spirv path
Related-To: NEO-4262

Signed-off-by: Kacper Kasper <kacper.k.kasper@intel.com>
2023-09-01 14:04:59 +02:00
Kacper Kasper ba4867c3d0 fix: compiler cache file extension and path creation
* When env variables did not have trailing slash, directory creation
could fail.
* If .cache in $HOME did not exist cache would have been disabled.

Signed-off-by: Kacper Kasper <kacper.k.kasper@intel.com>
2023-08-31 13:44:19 +02:00
Kacper Kasper 996c261430 fix: OclocIgcFacade->getIgcRevision() could return nullptr
* Make sure igcRevision is always initialized.
* Improve coverage.

Signed-off-by: Kacper Kasper <kacper.k.kasper@intel.com>
2023-08-31 12:57:27 +02:00
Naklicki, Mateusz 20862ad8fd fix: resolve builtins depending on the product
Related-To: NEO-6875
Signed-off-by: Naklicki, Mateusz <mateusz.naklicki@intel.com>
2023-08-29 15:25:08 +02:00
Kacper Kasper 991febcdf4 fix: extend cache hash with compiler commit sha, lib size and mtime
Related-To: NEO-4262

Signed-off-by: Kacper Kasper <kacper.k.kasper@intel.com>
2023-08-22 15:28:57 +02:00
Fabian Zwolinski 6fca8ee195 refactor: Remove SourceLevelDebugger
Removed:
- SourceLevelDebugger (with tests)
- DebuggerLibrary
- DebuggerLibraryRestore
- debuggerSupported field from hwInfo.capabilityTable
- HasSourceLevelDebuggerSupport matcher
- ExperimentalEnableSourceLevelDebugger debug var
- EnableMockSourceLevelDebugger debug var
- DebuggerOptDisable debug var
- lib_names.h.in file
- third_party/source_level_debugger/igfx_debug_interchange_types.h

Related-To: NEO-7213
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-08-10 11:14:02 +02:00
Katarzyna Cencelewska 6e93dd8068 fix: add check for igc compatibility without checking icbe
Related-To: NEO-7904
Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com>
2023-05-29 10:52:21 +02:00
Fabian Zwolinski 3f92f044a3 refactor: Remove default support for DCD Debugger
Related-To: NEO-7213
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-05-22 15:16:27 +02:00
Diedrich, Kamil 5a4a2ab8ab feature: Add new environment variables for compiler cache
This patch add new environment variables to control compiler cache.
Works as follow: If persistent cache is set driver check if NEO_CACHE_DIR
is set. If not then driver checks XDG_CACHE_HOME - If exists
then driver create neo_compiler_cache folder, if
not then driver checks HOME directory. If each NEO_CACHE_DIR,
XDG_CACHE_HOME and HOME are not set then compiler cache is disabled.
Current support is for Linux only.

Signed-off-by: Diedrich, Kamil <kamil.diedrich@intel.com>

Related-To: NEO-4262
2023-05-12 10:21:27 +02:00
Diedrich, Kamil 5149d74141 refactor: Remove globaly enabled cl_cache
Current behaviour will be detecd path existence

Related-To: NEO-4262

Signed-off-by: Diedrich, Kamil <kamil.diedrich@intel.com>
2023-04-28 23:28:49 +02:00
Cencelewska, Katarzyna 861ec524c6 fix: check icbe version only once when patchtoken
- set by default flag ZebinIgnoreIcbeVersion to true
- for zebin icbe version check is only inside flag
- only when use patchtoken then check icbe version is mandatory

Resolves: NEO-7904
Signed-off-by: Cencelewska, Katarzyna <katarzyna.cencelewska@intel.com>
2023-04-28 09:26:02 +02:00
Diedrich, Kamil 26ca64bb28 Add process safety to cl_cache on Linux
Current flow will be to have one synchronization point
config.file. Read remains unblocking, only write(caching)
operation will be blocking (lock on config.file)

Related-To: NEO-4262

Signed-off-by: Diedrich, Kamil <kamil.diedrich@intel.com>
2023-04-25 17:35:40 +02:00
Compute-Runtime-Validation ca51e557a2 Revert "Remove default support for DCD"
This reverts commit a3e923e359.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2023-04-20 04:41:33 +02:00
Fabian Zwolinski a3e923e359 Remove default support for DCD
Related-To: NEO-7213
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-04-19 19:18:48 +02:00
Mateusz Jablonski dd39b822d3 feature implicit args: patch rt dispatch global array in implicit args buffer
handle has_rtcalls in kernels and functions in zebin

Related-To: NEO-7818
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-03-28 12:31:38 +02:00
Jaroslaw Chodor f7cf09d195 fix(ocl) fixing race condition in createFclTranslationCtx
In rare case of multiple threads trying to set fclBaseTranslationCtx,
there was a potential for use after free (double delete) on
std::unique_ptr::reset.

Resolves: NEO-7767

Signed-off-by: Jaroslaw Chodor <jaroslaw.chodor@intel.com>
2023-03-06 16:47:18 +01:00
Krystian Chmielewski 58d3f892a9 refactor(zebin): move files to seperate directory
* Moved zebin related files to zebin directory.
* Moved zebin related code to Zebin namespace.
* Separated zeInfo from zebin elf.
* Seperated zeInfo decoding from zebin decoder.
* Refactored populateKernelPayloadArgument function.

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2023-03-03 21:48:19 +01:00
Compute-Runtime-Validation 84a7438ff2 Revert "refactor(zeInfo): move zeinfo to seperate file"
This reverts commit e3ce887662.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2023-03-03 11:56:52 +01:00
Krystian Chmielewski e3ce887662 refactor(zeInfo): move zeinfo to seperate file
* Moved zebin related files to zebin directory.
* Separated zeInfo from zebin elf.
* Seperated zeInfo decoding from zebin decoder.
* Refactored populateKernelPayloadArgument function.

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2023-03-02 12:46:56 +01:00
Krystian Chmielewski 5caf7f7290 feat(linker): allow use of local symbols
This commit adds support for handling local symbols.
* Added 2 fields to SymbolInfo - binding, and associated
instructions segment id.
* Simplified code for decoding elf symbols and relocations.
* Simplified code for patching instruction segments.
* Changed logic of decodeElfSymbolTableAndRelocations:
* Add every global symbol to symbol map.
* Add any local symbol used by relocation to symbol map.
* Changed logic of link:
* After performing relocations remove local symbols from map.
* Replaced UNRECOVERABLE_IF with returning error.
* Removed LocalSymbolInfo structure used before for local kernel jumps.
* Removed old tests.

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2023-03-02 12:39:21 +01:00
Pawel Cieslak 31d68c42e6 fix mismatched-new-delete when using unique_ptr
Related-To: NEO-6511
Signed-off-by: Pawel Cieslak <pawel.cieslak@intel.com>
2023-02-14 08:07:13 +01:00
Kacper Nowak 7790e208fd feat(zebin): Add support for ELF section type SHT_NOBITS
This commit adds support for parsing SHT_NOBITS zebin's ELF sections
(containing global/constant zero-initialized data).
- Correction: in CTNI path, do not add related symbol if surface has not
been allocated.

Related-To: NEO-7196
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2023-02-10 16:17:16 +01:00
Kamil Kopryk cab4b956eb refactor: rename compiler product helper files
Related-To: NEO-6853
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
2023-02-03 09:03:24 +01:00
Compute-Runtime-Validation d0c0c60205 Revert "feat(zebin): Add support for ELF section type SHT_NOBITS"
This reverts commit fa03aa9a40.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2023-02-03 03:44:02 +01:00
Kacper Nowak fa03aa9a40 feat(zebin): Add support for ELF section type SHT_NOBITS
This commit adds support for parsing SHT_NOBITS zebin's ELF sections
(containing global/constant zero-initialized data).

Related-To: NEO-7196
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2023-02-02 14:54:51 +01:00
Warchulski, Jaroslaw fe8a6d98ad Cleanup includes 45
Cleaned up files:
opencl/source/api/api.h
shared/source/command_stream/csr_deps.h
shared/source/helpers/engine_node_helper.h

Related-To: NEO-5548
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2023-01-26 11:12:15 +01:00
Warchulski, Jaroslaw c275008e51 Cleanup includes 32
Cleaned up files:
level_zero/core/source/cmdlist/cmdlist_hw.h
level_zero/core/source/cmdqueue/cmdqueue.h
level_zero/core/source/event/event.h
opencl/source/helpers/get_info_status_mapper.h
opencl/source/helpers/hardware_commands_helper.h
shared/source/helpers/per_thread_data.h

Related-To: NEO-5548
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2023-01-16 20:41:37 +01:00
Mateusz Jablonski 43b790957d style: format code using clang-format 15.0.6
Related-To: NEO-7500
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-01-05 10:33:47 +01:00
Warchulski, Jaroslaw 0eac749fcc Cleanup includes 19
Cleaned up files:
opencl/source/api/cl_types.h
shared/source/compiler_interface/external_functions.h
shared/source/compiler_interface/linker.h
shared/source/device_binary_format/elf/elf.h
shared/source/helpers/preamble.h
shared/source/memory_manager/definitions/storage_info.h
shared/source/memory_manager/memory_manager.h
shared/source/memory_manager/os_agnostic_memory_manager.h
shared/source/program/program_info.h

Related-To: NEO-5548
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2023-01-03 11:02:05 +01:00
Warchulski, Jaroslaw a2fe929f0c Cleanup includes 18
Cleaned up files:
shared/source/command_stream/command_stream_receiver_hw.h
shared/source/compiler_interface/compiler_interface.h
shared/source/direct_submission/direct_submission_hw.h
shared/source/helpers/dirty_state_helpers.h

Related-To: NEO-5548
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2023-01-02 13:28:29 +01:00
Krystian Chmielewski 6ec5647b36 fix(zebin): allow for recursive function calls
Allow for loops when detecting function dependency in zebin.

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2022-11-21 16:25:51 +01:00
Luzynski, Sebastian Jozef 91c69e0fe7 Patch global variables and constants once
This change replaces mechanism of patching global constants and
variables in kernel per relocation to patching them only once. This
would improve linking time performance for kernels with multiple global
symbols.

Signed-off-by: Luzynski, Sebastian Jozef <sebastian.jozef.luzynski@intel.com>
2022-11-03 17:45:09 +01:00
Dunajski, Bartosz 7ff37cd5fd Ftr/WA flags cleanup
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
2022-10-26 12:11:31 +02:00
Kacper Nowak b1731626d0 Correct spelling mistakes
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2022-10-20 15:53:23 +02:00
Dunajski, Bartosz ad2d3d0289 Remove not used method
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
2022-10-05 17:10:51 +02: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
Dunajski, Bartosz 670926c9b6 Remove redundant MockCompilerEnableGuard instances
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
2022-09-21 10:07:18 +02:00
Kacper Nowak 710c8cf5ef Linker: add support for symbols with local binding
This commits add support for relocating
symbols with local binding and of functional type
(STB_LOCAL, STT_FUNC).

Related-To: NEO-7299
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2022-09-08 14:50:29 +02:00
Dunajski, Bartosz 16d9000429 Add option to change GRF mode
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
2022-09-06 13:00:17 +02:00
Kacper Nowak 497e5a4765 Zebin: Create mock zebin module for L0 common test module
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2022-08-17 15:12:49 +02:00
Kacper Nowak 44d218e52e Linker: Add support for relocation type PerThreadPayloadOffset
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2022-08-16 19:14:27 +02:00
Mateusz Jablonski 6a46e8f0ca Correct method names in device and module fixtures
correct naming in derived classes

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2022-08-12 10:40:56 +02:00
Dominik Dabek 0263ec0d84 Add test kernel for indirect allocations
Add kernel for testing indirect allocation
address getting passed by value.

Needed for future commit.

Related-To: NEO-6597

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2022-08-11 14:00:06 +02:00
Warchulski, Jaroslaw a6c1d9578e Move files between shared/test/common/helpers and shared/test/unit_test/helpersi
unit_test/helpers/cmd_buffer_validator.h -> common/helpers
unit_test/helpers/gtest_helpers.h -> common/helpers
common/helpers/blit_commands_helper_tests.inl -> unit_test/helpers
common/helpers/simd_helper_tests.inl -> unit_test/helpers
common/helpers/simd_helper_tests_pvc_and_later.inl -> unit_test/helpers
common/helpers/state_base_address_tests.h -> unit_test/helpers

Related-To: NEO-6524
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2022-08-10 15:23:12 +02:00
Warchulski, Jaroslaw e7cca25894 CMake: don't include shared/test/unit_test when shared tests are skipped 1/n
Related-To: NEO-6524
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2022-08-09 11:41:09 +02:00
Kacper Nowak c046824c18 Linker: do not process relocations for symbols with unknown segment type
In decodeElfSymbolTableAndRelocations, when symbol's section is of
unknown type, then do not add it to linker's symbol table.
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2022-07-25 20:11:31 +02:00
Artur Harasimiuk 4bdd8860a1 test.h refactor
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
2022-07-04 18:20:07 +02:00
Mateusz Jablonski 7e144d73f6 Dont patch implicit args relocation to zero
IGC should set the value to zero by default

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2022-06-30 20:26:04 +02:00
Artur Harasimiuk a8e2bd3f98 hw_cmds.h usage cleanup
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
2022-06-29 11:15:45 +02:00
Bartosz Dunajski 5510dc7daa Add adjustHwInfoForIgc support
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
2022-06-13 14:31:53 +02:00
Kamil Diedrich ddd8a08fac Add mechanism to avoid calling gdi calls while process exit
Signed-off-by: Kamil Diedrich <kamil.diedrich@intel.com>
2022-05-20 11:11:52 +02:00
Artur Harasimiuk e9be9b64c6 clang-tidy configuration cleanup
Define single .clang-tidy configuration with all used checks and use
NOLINT to selectively silence tool. That way cleanup should be easier.
third_part/ has its own configuration that disables clang-tidy for this
folder.

Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
2022-05-11 14:02:04 +02:00
Mateusz Jablonski 188bf3c6fa Remove not needed relocation name for implicit args
Related-To: NEO-5081
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2022-04-26 17:29:54 +02:00
Krystian Chmielewski 34ebcc9520 Zebin: Use addend in relocations
feat(zebin): Use addend from RELA sections when performing relocations.

Resolves: NEO-6898

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2022-04-19 09:19:26 +02:00
Krystian Chmielewski 6023a5b58e Zebin: don't fail when extfunc caller cannot be found
This commit removes early fail in linking with zebin and external
functions which happens when, there's a relocation to external functions
section, but it's not modifying any external function. And only treats
GLOBAL FUNC symbols pointing to external functions section as external
function symbols.

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2022-03-30 13:53:25 +02:00
Fabian Zwolinski 3d8effcd69 Clean-Up unused code related to GMock
This commit:
- Removes usings e.g. ::testing::Return
- Removes unnecessary gmock inclues
- Replaces Gmock macros (e.g. EXPECT_THAT) with our custom implementations

Related-To: NEO-4941
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2022-03-22 16:16:34 +01:00
Kamil Kopryk 073e15d75e Change macro for ult
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
Related-To: NEO-6738
2022-03-22 10:13:45 +01:00
Mateusz Jablonski c7e76ce109 Add support for a new relocation name for implicit args
Related-To: NEO-5081
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2022-03-15 12:03:51 +01:00
Mateusz Jablonski 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
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
Krystian Chmielewski 439389ae19 Do not resolve external functions when none passed
This commit adds check in Linker::resolveExternalFunctions checking
if external functions are present before trying to resolve dependencies
and adds default values for ExternalFunctionInfo.

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2022-03-07 19:05:17 +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
Neil R Spruit fc11701422 LLVM IR removed from Compiler Link
Signed-off-by: Neil R Spruit <neil.r.spruit@intel.com>
2022-03-02 17:25:36 +01:00
Mateusz Jablonski 61e5e0687d Patch all implicit args relocations within every kernel
Related-To: NEO-5081
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2022-01-11 14:34:28 +01:00
Kamil Diedrich 34856747b4 Add implementation for reading logical subDevice from builtin
Related-To: NEO-6258
Signed-off-by: Kamil Diedrich <kamil.diedrich@intel.com>
2022-01-11 13:06:15 +01:00
Dominik Dabek 300a971af3 Use igc interface to get max param size
IGC will be queried for max parameter size at the end of initializing
device caps.

Related-To: NEO-4851

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2021-12-28 16:10:05 +01:00
Kamil Diedrich 2bbe7438ce Revert "Add implementation for reading logical subDevice from builtin"
This reverts commit 901e1e71f95a8cd90611ed7cbd25705a14f38170.

Signed-off-by: Kamil Diedrich <kamil.diedrich@intel.com>
2021-12-27 15:58:51 +01:00
Patryk Wrobel 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
Mateusz Jablonski 527806b3ed Use full path to include test.h 2/n
fix files in shared

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2021-12-15 13:09:50 +01:00
Krystian Chmielewski 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
Kamil Diedrich 24c19509b3 Add implementation for reading logical subDevice from builtin
- add function for resolving builtins using relocations
- add relocation for __SubDeviceID symbol

Related-To: NEO-6258
Signed-off-by: Kamil Diedrich <kamil.diedrich@intel.com>
2021-12-09 13:20:49 +01:00
Mateusz Hoppe d72a4491be Add error handling in SipKernelBinary
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2021-11-29 13:25:15 +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
Mateusz Jablonski c83828be6c Move compiler interface tests to shared tests
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2021-11-25 12:35:06 +01:00
Artur Harasimiuk 7eb5b6aa42 mock dlopen in tests to block unwanted interactions
- explicitly specify files allowed to dlopen()
- use underscore to prefix fake library name that we want dlopen to
return nullptr


Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
2021-11-23 12:55:48 +01:00
Mateusz Jablonski abb1f30cd0 Program implicit args only in case of stack calls or enabled debugger
Related-To: NEO-5081
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2021-11-18 14:33:11 +01:00
Kamil Kopryk 7b8820f23e Simplify ults
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
2021-11-17 14:46:08 +01:00
Artur Harasimiuk 35f135bbc8 compiler cache to store input into separate file
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
2021-11-16 17:23:17 +01:00
Mateusz Jablonski 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
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