@@ -17,9 +17,14 @@ alongside options to guide the compilation.
1717 * This library can be used for compilation on systems without AMD GPU drivers
1818 installed (offline compilation). However, running the compiled code still
1919 requires both the HIP runtime library and GPU drivers on the target system.
20- * This library depends on Code Object Manager (comgr). You can try to
21- statically link comgr into HIPRTC to avoid ambiguity.
2220 * Developers can bundle this library with their application.
21+ * HIPRTC leverages AMD's Code Object Manager API (``Comgr ``) internally, which
22+ is designed to simplify linking, compiling, and inspecting code objects. For
23+ more information, see the `llvm-project/amd/comgr/README <https://github.com/ROCm/llvm-project/blob/amd-staging/amd/comgr/README.md >`_.
24+ * Comgr may cache HIPRTC compilations. To force full recompilation for each HIPRTC API invocation, set AMD_COMGR_CACHE=0.
25+
26+ - When viewing the *README * in the Comgr GitHub repository you should look at a
27+ specific branch of interest, such as ``docs/6.3.0 `` or ``docs/6.4.1 ``, rather than the default branch.
2328
2429Compilation APIs
2530===============================================================================
@@ -250,45 +255,6 @@ The full example is below:
250255 HIP_CHECK(hipFree(doutput));
251256 }
252257
253-
254- Kernel Compilation Cache
255- ===============================================================================
256-
257- HIPRTC incorporates a cache to avoid recompiling kernels between program
258- executions. The contents of the cache include the kernel source code (including
259- the contents of any ``#include `` headers), the compilation flags, and the
260- compiler version. After a ROCm version update, the kernels are progressively
261- recompiled, and the new results are cached. When the cache is disabled, each
262- kernel is recompiled every time it is requested.
263-
264- Use the following environment variables to manage the cache status as enabled or
265- disabled, the location for storing the cache contents, and the cache eviction
266- policy:
267-
268- * ``AMD_COMGR_CACHE `` By default this variable is unset and the
269- compilation cache feature is enabled. To disable the feature set the
270- environment variable to a value of ``0 ``.
271-
272- * ``AMD_COMGR_CACHE_DIR ``: By default the value of this environment variable is
273- defined as ``$XDG_CACHE_HOME/comgr ``, which defaults to
274- ``$USER/.cache/comgr `` on Linux, and ``%LOCALAPPDATA%\cache\comgr ``
275- on Windows. You can specify a different directory for the environment variable
276- to change the path for cache storage. If the runtime fails to access the
277- specified cache directory the cache is disabled. If the environment variable
278- is set to an empty string (``"" ``), the default directory is used.
279-
280- * ``AMD_COMGR_CACHE_POLICY ``: If assigned a value, the string is interpreted and
281- applied to the cache pruning policy. The string format is consistent with
282- `Clang's ThinLTO cache pruning policy <https://rocm.docs.amd.com/projects/llvm-project/en/latest/LLVM/clang/html/ThinLTO.html#cache-pruning >`_.
283- The default policy is defined as:
284- ``prune_interval=1h:prune_expiration=0h:cache_size=75%:cache_size_bytes=30g:cache_size_files=0 ``.
285- If the runtime fails to parse the defined string, or the environment variable
286- is set to an empty string (""), the cache is disabled.
287-
288- .. note ::
289-
290- This cache is also shared with the OpenCL runtime shipped with ROCm.
291-
292258 HIPRTC specific options
293259===============================================================================
294260
@@ -484,14 +450,18 @@ application requires the ingestion of bitcode/IR not derived from the currently
484450installed AMD compiler, it must run with HIPRTC and comgr dynamic libraries that
485451are compatible with the version of the bitcode/IR.
486452
487- `Comgr <https://github.com/ROCm/llvm-project/tree/amd-staging/amd/comgr >`_ is a
453+ `Comgr <https://github.com/ROCm/llvm-project/tree/amd-staging/amd/comgr/README.md >`_ is a
488454shared library that incorporates the LLVM/Clang compiler that HIPRTC relies on.
489455To identify the bitcode/IR version that comgr is compatible with, one can
490456execute "clang -v" using the clang binary from the same ROCm or HIP SDK package.
491457For instance, if compiling bitcode/IR version 14, the HIPRTC and comgr libraries
492458released by AMD around mid 2022 would be the best choice, assuming the
493459LLVM/Clang version included in the package is also version 14.
494460
461+ .. note ::
462+ When viewing the *README * in the Comgr GitHub repository you should look at a
463+ specific branch of interest, such as ``docs/6.3.0 `` or ``docs/6.4.1 ``, rather than the default branch.
464+
495465To ensure smooth operation and compatibility, an application may choose to ship
496466the specific versions of HIPRTC and comgr dynamic libraries, or it may opt to
497467clearly specify the version requirements and dependencies. This approach
0 commit comments