You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@__spirv_BuiltInGlobalInvocationId = external dso_local local_unnamed_addraddrspace(1) constant <3 x i64>, align32
23
23
@__asan_func = internaladdrspace(2) constant [106 x i8] c"typeinfo name for main::'lambda'(sycl::_V1::handler&)::operator()(sycl::_V1::handler&) const::MyKernelR_4\00"
@__spirv_BuiltInGlobalInvocationId = external dso_local local_unnamed_addraddrspace(1) constant <3 x i64>, align32
23
23
@__asan_func = internaladdrspace(2) constant [106 x i8] c"typeinfo name for main::'lambda'(sycl::_V1::handler&)::operator()(sycl::_V1::handler&) const::MyKernelR_4\00"
Copy file name to clipboardExpand all lines: sycl/doc/design/KernelProgramCache.md
+10-9Lines changed: 10 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -415,15 +415,16 @@ When adding a new program to cache, we check if the size of the program cache ex
415
415
416
416
#### Persistent cache eviction
417
417
418
-
Persistent cache eviction is going to be applied based on file last access
419
-
(read/write) date (access time). On SYCL application shutdown phase cache
420
-
eviction process is initiated which walks through cache directories as follows:
421
-
422
-
- if the file is locked, go to the next file;
423
-
- otherwise check file access time:
424
-
- if file access time is above threshold, delete the file and remove parent
425
-
directory while they are unlocked and empty;
426
-
- otherwise do nothing.
418
+
Persistent cache eviction can be enabled using the SYCL_CACHE_MAX_SIZE environment variable and is based on the LRU strategy.
419
+
420
+
- A new file, called `cache_size.txt`, is created at the root of the persistent cache directory. This file contains the total size of the cache in bytes. When a new item is added to the cache, the size of the item is added to the total size in the `cache_size.txt` file. When the total size exceeds the threshold, the eviction process is initiated.
421
+
422
+
- Whenever a cache entry is added or accessed, the corresponding cache item directory is updated with the current time. This is done by creating a new file, called `<entry name>_access_time.txt`, in the cache item directory. This file contains the current time in nanoseconds since the epoch. When the eviction process is initiated, we use this file to determine the last access time of the cache item.
423
+
424
+
- When a new item is added to the cache, we check if the total size exceeds the threshold. If so, we iterate through the cache item directories and delete the least recently accessed items until the total size is below half the cache size.
425
+
426
+
Note that once the eviction is triggered, the cache size is reduced to half the cache size to avoid frequent eviction.
0 commit comments