Commit Graph

182 Commits

Author SHA1 Message Date
Weronika Kapusta d6c16c1640 fix: remove compiler cache legacy implementation
Related-To: NEO-10679

Signed-off-by: Weronika Kapusta <weronika.kapusta@intel.com>
2024-05-06 18:28:35 +02:00
Timo Aaltonen cb984b3e4b fix: Fix various typos.
Signed-off-by: Timo Aaltonen <tjaalton@debian.org>
2024-04-17 20:03:06 +02:00
Mateusz Hoppe a9366fff48 refactor: print message with location when cache is enabled
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2024-04-11 17:08:39 +02:00
Compute-Runtime-Validation 9568ee47e7 Revert "fix: remove compiler cache legacy implementation"
This reverts commit 864f42116c.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2024-04-09 02:06:51 +02:00
Weronika Kapusta 864f42116c fix: remove compiler cache legacy implementation
Related-To: NEO-10679
Signed-off-by: Kapusta, Weronika <weronika.kapusta@intel.com>
2024-04-08 16:40:57 +02:00
Kacper Nowak 35ca2bbea9 refactor: refactor logic for querying atomic FP capabilities
- Move logic from product helper to compiler product helper
- Add method for adjusting fp16 and extra capabilities using release
helper (if present).


Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2024-03-28 15:27:45 +01:00
Fabian Zwolinski 52430762ac fix: cl_cache L0 env vars + refactor code structure
Added support for new Compiler Cache
environment variables in Level Zero.

Moved
`opencl/source/compiler_interface/default_cache_config.cpp`
`level_zero/core/source/compiler_interface/default_cache_config.cpp`
to shared directory
`source/compiler_interface/default_cache_config.cpp`

Switched enabling cache by default from per OS to per API.
Changed default state of cl_cache in Level Zero to disabled.

Related-To: NEO-10045
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2024-03-01 17:35:08 +01:00
Fabian Zwolinski a27dafd2e1 fix: cl_cache store binary and debug data in one file
Related-To: NEO-10045
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2024-02-29 10:13:15 +01:00
Dominik Dabek 239831f097 fix: return error for 0 size usm allocations
according to both level zero and opencl specs, usm allocations with
size=0 should return invalid/unsupported buffer size errors

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
2023-12-22 17:26:39 +01:00
Mateusz Jablonski a4888b39c6 build: add clang-tidy restriction for Enum case
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-12-21 08:58:51 +01:00
Mateusz Jablonski a6458433dc refactor: correct naming of enum class constants 9/n
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-12-19 10:36:25 +01:00
Mateusz Jablonski dd1b9d6abc refactor: correct naming of enum class constants 8/n
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-12-19 08:18:18 +01:00
Chodor, Jaroslaw 7e795cd3c1 feature: Adding support for OCL C support queries to ocloc
Feature needed for automated OCL C compilation with ocloc as backend.
Added queries :
* CL_DEVICE_EXTENSIONS
* CL_DEVICE_EXTENSIONS_WITH_VERSION
* CL_DEVICE_PROFILE
* CL_DEVICE_OPENCL_C_ALL_VERSIONS
* CL_DEVICE_OPENCL_C_FEATURES

Sample command line:
ocloc query -device skl CL_DEVICE_OPENCL_C_FEATURES

Related-To: GSD-7420

Signed-off-by: Chodor, Jaroslaw <jaroslaw.chodor@intel.com>
2023-12-18 15:19:16 +01:00
Dunajski, Bartosz d99104d5bf refactor: improve ImplicitArg struct handling
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
2023-12-18 15:19:00 +01:00
Mateusz Jablonski beafea9b39 refactor: correct naming of enum class constants 2/n
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-12-11 13:13:35 +01:00
Fabian Zwolinski ee53bf0839 fix: linux cl_cache eviction mechanism
Fixed and 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-12-05 09:35:48 +01:00
Mateusz Jablonski c9664e6bad refactor: rename global debug manager to debugManager
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-11-30 13:00:59 +01:00
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