Skip to content

Commit

Permalink
Add AMD_COMGR_CACHE variable to enable cache
Browse files Browse the repository at this point in the history
  • Loading branch information
randyh62 committed Jan 31, 2025
1 parent 72bc5d7 commit b966999
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/how-to/hip_rtc.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,11 @@ HIPRTC incorporates a cache to avoid recompiling kernels between program executi

The cache's status as enabled or disabled, the location for storing the cache contents, and the cache eviction policy can be managed using the following environment variables:

* `AMD_COMGR_CACHE_DIR`: By default the value of this environment variable is defined as `$XDG_CACHE_HOME/comgr_cache`, which defaults to `$USER/.cache/comgr_cache` on Linux, and `%LOCALAPPDATA%\cache\comgr_cache` on Windows. You can disable the cache by setting the environment variable to an empty string, "". You can also specify a different directory for the environment variable to change the path for cache storage. If the runtime fails to access the specified cache directory, the cache is disabled.
* `AMD_COMGR_CACHE` By default this variable has a value of `0` and the compilation cache feature is disabled. To enable the feature set the environment variable to a value of `1` (or any value other than `0`). This behavior may change in a future release.

* `AMD_COMGR_CACHE_POLICY`: If assigned a value, the string is interpreted and applied to the cache pruning policy. The string format is consistent with [Clang's ThinLTO cache pruning policy](https://rocm.docs.amd.com/projects/llvm-project/en/latest/LLVM/clang/html/ThinLTO.html#cache-pruning). The default policy is defined as: `prune_interval=1h:prune_expiration=0h:cache_size=75%:cache_size_bytes=30g:cache_size_files=0`. You can disable the cache by setting the environment variable to an empty string, "". If the runtime fails to parse the defined string, the cache is disabled.
* `AMD_COMGR_CACHE_DIR`: By default the value of this environment variable is defined as `$XDG_CACHE_HOME/comgr_cache`, which defaults to `$USER/.cache/comgr_cache` on Linux, and `%LOCALAPPDATA%\cache\comgr_cache` on Windows. You can specify a different directory for the environment variable to change the path for cache storage. If the runtime fails to access the specified cache directory, or the environment variable is set to an empty string (""), the cache is disabled.

Check failure on line 235 in docs/how-to/hip_rtc.md

View workflow job for this annotation

GitHub Actions / Documentation / Markdown

Trailing spaces

docs/how-to/hip_rtc.md:235:428 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.28.2/doc/md009.md

* `AMD_COMGR_CACHE_POLICY`: If assigned a value, the string is interpreted and applied to the cache pruning policy. The string format is consistent with [Clang's ThinLTO cache pruning policy](https://rocm.docs.amd.com/projects/llvm-project/en/latest/LLVM/clang/html/ThinLTO.html#cache-pruning). The default policy is defined as: `prune_interval=1h:prune_expiration=0h:cache_size=75%:cache_size_bytes=30g:cache_size_files=0`. If the runtime fails to parse the defined string, or the environment variable is set to an empty string (""), the cache is disabled.

Check failure on line 237 in docs/how-to/hip_rtc.md

View workflow job for this annotation

GitHub Actions / Documentation / Markdown

Trailing spaces

docs/how-to/hip_rtc.md:237:176 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.28.2/doc/md009.md

:::{note}
This cache is also shared with the OpenCL runtime shipped with ROCm.
Expand Down

0 comments on commit b966999

Please sign in to comment.