doc, build: added version selector for developer guide

This commit is contained in:
Vadim Pirogov
2025-07-17 10:35:47 -07:00
parent 0de00c717a
commit ee33cdcf63
3 changed files with 49 additions and 31 deletions

View File

@ -64,7 +64,12 @@ option(ONEDNN_ENABLE_GRAPH_DUMP "enables control of dumping graph artifacts via
set(DNNL_LIBRARY_TYPE "SHARED" CACHE STRING set(DNNL_LIBRARY_TYPE "SHARED" CACHE STRING
"specifies whether oneDNN library should be SHARED or STATIC") "specifies whether oneDNN library should be SHARED or STATIC")
option(DNNL_BUILD_DOC "builds documentation" ${DNNL_IS_MAIN_PROJECT}) option(DNNL_BUILD_DOC "builds documentation" ${DNNL_IS_MAIN_PROJECT})
set(ONEDNN_DOC_VERSIONS_JSON "" CACHE STRING "Location of JSON file for
PyData Sphinx Theme version switcher. Must be a stable, persistent,
fully resolved URL. Enables documentation version switcher when set.")
option(DNNL_BUILD_EXAMPLES "builds examples" ${DNNL_IS_MAIN_PROJECT}) option(DNNL_BUILD_EXAMPLES "builds examples" ${DNNL_IS_MAIN_PROJECT})
option(DNNL_BUILD_TESTS "builds tests" ${DNNL_IS_MAIN_PROJECT}) option(DNNL_BUILD_TESTS "builds tests" ${DNNL_IS_MAIN_PROJECT})
option(DNNL_BUILD_FOR_CI option(DNNL_BUILD_FOR_CI

View File

@ -3,37 +3,40 @@ Use Build Options {#dev_guide_build_options}
oneDNN supports the following build-time options. oneDNN supports the following build-time options.
| CMake Option | Supported values (defaults in bold) | Description | | CMake Option | Supported values (defaults in bold) | Description |
|:--------------------------------|:----------------------------------------------------|:------------------------------------------------------------------------------------------------| |:--------------------------------|:----------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------|
| ONEDNN_LIBRARY_TYPE | **SHARED**, STATIC | Defines the resulting library type | | ONEDNN_LIBRARY_TYPE | **SHARED**, STATIC | Defines the resulting library type |
| ONEDNN_CPU_RUNTIME | NONE, **OMP**, TBB, SEQ, THREADPOOL, SYCL | Defines the threading runtime for CPU engines | | ONEDNN_CPU_RUNTIME | NONE, **OMP**, TBB, SEQ, THREADPOOL, SYCL | Defines the threading runtime for CPU engines |
| ONEDNN_GPU_RUNTIME | **NONE**, OCL, SYCL | Defines the offload runtime for GPU engines | | ONEDNN_GPU_RUNTIME | **NONE**, OCL, SYCL | Defines the offload runtime for GPU engines |
| ONEDNN_BUILD_DOC | **ON**, OFF | Controls building the documentation | | ONEDNN_BUILD_DOC | **ON**, OFF | Controls building the documentation |
| ONEDNN_BUILD_EXAMPLES | **ON**, OFF | Controls building the examples | | ONEDNN_DOC_VERSIONS_JSON | **""**, *string* | Location of JSON file for [PyData Sphinx Theme version switcher]. Enables documentation version switcher when set. |
| ONEDNN_BUILD_TESTS | **ON**, OFF | Controls building the tests | | ONEDNN_BUILD_EXAMPLES | **ON**, OFF | Controls building the examples |
| ONEDNN_BUILD_GRAPH | **ON**, OFF | Controls building graph component | | ONEDNN_BUILD_TESTS | **ON**, OFF | Controls building the tests |
| ONEDNN_ENABLE_GRAPH_DUMP | ON, **OFF** | Controls dumping graph artifacts | | ONEDNN_BUILD_GRAPH | **ON**, OFF | Controls building graph component |
| ONEDNN_ARCH_OPT_FLAGS | *compiler flags* | Specifies compiler optimization flags (see warning note below) | | ONEDNN_ENABLE_GRAPH_DUMP | ON, **OFF** | Controls dumping graph artifacts |
| ONEDNN_ENABLE_CONCURRENT_EXEC | ON, **OFF** | Disables sharing a common scratchpad between primitives in #dnnl::scratchpad_mode::library mode | | ONEDNN_ARCH_OPT_FLAGS | *compiler flags* | Specifies compiler optimization flags (see warning note below) |
| ONEDNN_ENABLE_JIT_PROFILING | **ON**, OFF | Enables [integration with performance profilers](@ref dev_guide_profilers) | | ONEDNN_ENABLE_CONCURRENT_EXEC | ON, **OFF** | Disables sharing a common scratchpad between primitives in #dnnl::scratchpad_mode::library mode |
| ONEDNN_ENABLE_ITT_TASKS | **ON**, OFF | Enables [integration with performance profilers](@ref dev_guide_profilers) | | ONEDNN_ENABLE_JIT_PROFILING | **ON**, OFF | Enables [integration with performance profilers](@ref dev_guide_profilers) |
| ONEDNN_ENABLE_PRIMITIVE_CACHE | **ON**, OFF | Enables [primitive cache](@ref dev_guide_primitive_cache) | | ONEDNN_ENABLE_ITT_TASKS | **ON**, OFF | Enables [integration with performance profilers](@ref dev_guide_profilers) |
| ONEDNN_ENABLE_MAX_CPU_ISA | **ON**, OFF | Enables [CPU dispatcher controls](@ref dev_guide_cpu_dispatcher_control) | | ONEDNN_ENABLE_PRIMITIVE_CACHE | **ON**, OFF | Enables [primitive cache](@ref dev_guide_primitive_cache) |
| ONEDNN_ENABLE_CPU_ISA_HINTS | **ON**, OFF | Enables [CPU ISA hints](@ref dev_guide_cpu_isa_hints) | | ONEDNN_ENABLE_MAX_CPU_ISA | **ON**, OFF | Enables [CPU dispatcher controls](@ref dev_guide_cpu_dispatcher_control) |
| ONEDNN_ENABLE_WORKLOAD | **TRAINING**, INFERENCE | Specifies a set of functionality to be available based on workload | | ONEDNN_ENABLE_CPU_ISA_HINTS | **ON**, OFF | Enables [CPU ISA hints](@ref dev_guide_cpu_isa_hints) |
| ONEDNN_ENABLE_PRIMITIVE | **ALL**, PRIMITIVE_NAME | Specifies a set of functionality to be available based on primitives | | ONEDNN_ENABLE_WORKLOAD | **TRAINING**, INFERENCE | Specifies a set of functionality to be available based on workload |
| ONEDNN_ENABLE_PRIMITIVE_CPU_ISA | **ALL**, CPU_ISA_NAME | Specifies a set of functionality to be available for CPU backend based on CPU ISA | | ONEDNN_ENABLE_PRIMITIVE | **ALL**, PRIMITIVE_NAME | Specifies a set of functionality to be available based on primitives |
| ONEDNN_ENABLE_PRIMITIVE_GPU_ISA | **ALL**, GPU_ISA_NAME | Specifies a set of functionality to be available for GPU backend based on GPU ISA | | ONEDNN_ENABLE_PRIMITIVE_CPU_ISA | **ALL**, CPU_ISA_NAME | Specifies a set of functionality to be available for CPU backend based on CPU ISA |
| ONEDNN_ENABLE_GEMM_KERNELS_ISA | **ALL**, NONE, ISA_NAME | Specifies a set of functionality to be available for GeMM kernels for CPU backend based on ISA | | ONEDNN_ENABLE_PRIMITIVE_GPU_ISA | **ALL**, GPU_ISA_NAME | Specifies a set of functionality to be available for GPU backend based on GPU ISA |
| ONEDNN_EXPERIMENTAL | ON, **OFF** | Enables [experimental features](@ref dev_guide_experimental) | | ONEDNN_ENABLE_GEMM_KERNELS_ISA | **ALL**, NONE, ISA_NAME | Specifies a set of functionality to be available for GeMM kernels for CPU backend based on ISA |
| ONEDNN_VERBOSE | **ON**, OFF | Enables [verbose mode](@ref dev_guide_verbose) | | ONEDNN_EXPERIMENTAL | ON, **OFF** | Enables [experimental features](@ref dev_guide_experimental) |
| ONEDNN_DEV_MODE | ON, **OFF** | Enables internal tracing and `debuginfo` logging in verbose output (for oneDNN developers) | | ONEDNN_VERBOSE | **ON**, OFF | Enables [verbose mode](@ref dev_guide_verbose) |
| ONEDNN_AARCH64_USE_ACL | ON, **OFF** | Enables integration with Arm Compute Library for AArch64 builds | | ONEDNN_DEV_MODE | ON, **OFF** | Enables internal tracing and `debuginfo` logging in verbose output (for oneDNN developers) |
| ONEDNN_BLAS_VENDOR | **NONE**, ARMPL, ACCELERATE | Defines an external BLAS library to link to for GEMM-like operations | | ONEDNN_AARCH64_USE_ACL | ON, **OFF** | Enables integration with Arm Compute Library for AArch64 builds |
| ONEDNN_GPU_VENDOR | NONE, **INTEL**, NVIDIA, AMD | When DNNL_GPU_RUNTIME is not NONE defines GPU vendor for GPU engines otherwise its value is NONE| | ONEDNN_BLAS_VENDOR | **NONE**, ARMPL, ACCELERATE | Defines an external BLAS library to link to for GEMM-like operations |
| ONEDNN_DPCPP_HOST_COMPILER | **DEFAULT**, *GNU or Clang C++ compiler executable* | Specifies host compiler executable for SYCL runtime | | ONEDNN_GPU_VENDOR | NONE, **INTEL**, NVIDIA, AMD | When DNNL_GPU_RUNTIME is not NONE defines GPU vendor for GPU engines otherwise its value is NONE |
| ONEDNN_LIBRARY_NAME | **dnnl**, *library name* | Specifies name of the library | | ONEDNN_DPCPP_HOST_COMPILER | **DEFAULT**, *GNU or Clang C++ compiler executable* | Specifies host compiler executable for SYCL runtime |
| ONEDNN_TEST_SET | SMOKE, **CI**, NIGHTLY, MODIFIER_NAME | Specifies the testing coverage enabled through the generated testing targets | | ONEDNN_LIBRARY_NAME | **dnnl**, *library name* | Specifies name of the library |
| ONEDNN_TEST_SET | SMOKE, **CI**, NIGHTLY, MODIFIER_NAME | Specifies the testing coverage enabled through the generated testing targets |
[PyData Sphinx Theme version switcher]: https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/version-dropdown.html
All building options listed support their counterparts with `DNNL` prefix All building options listed support their counterparts with `DNNL` prefix
instead of `ONEDNN`. `DNNL` options would take precedence over `ONEDNN` instead of `ONEDNN`. `DNNL` options would take precedence over `ONEDNN`

View File

@ -154,9 +154,19 @@ html_theme_options = {
"use_download_button": True, "use_download_button": True,
"path_to_docs": "doc", "path_to_docs": "doc",
"use_issues_button": True, "use_issues_button": True,
"check_switcher": False,
"extra_footer": "oneDNN is licensed under Apache License Version 2.0. Refer to the <a href='https://github.com/uxlfoundation/oneDNN/blob/main/LICENSE'>LICENSE</a> file for the full license text and copyright notice." "extra_footer": "oneDNN is licensed under Apache License Version 2.0. Refer to the <a href='https://github.com/uxlfoundation/oneDNN/blob/main/LICENSE'>LICENSE</a> file for the full license text and copyright notice."
} }
# Adding version switcher if ONEDNN_DOC_VERSIONS_JSON is provided
json_url = '@ONEDNN_DOC_VERSIONS_JSON@'
if json_url:
html_theme_options["switcher"] = {
"json_url": json_url,
"version_match": version
}
html_theme_options["article_header_start"] = ["toggle-primary-sidebar", "version-switcher"]
mathjax3_config = { mathjax3_config = {
'tex': { 'tex': {
'macros': { 'macros': {