Skip to content

Commit

Permalink
Promote HAL driver and target backend CMake variables to options. (#7936
Browse files Browse the repository at this point in the history
)

Following up on #7905 (comment), this uses regular options for these settings, which are easier to search for and set. The CMakeLists from Tint was used as a reference: https://dawn.googlesource.com/tint/+/refs/heads/main/CMakeLists.txt. The main focus is to use explicit names instead of dynamic name construction, but using [option](https://cmake.org/cmake/help/latest/command/option.html) is a nice bonus.

New `IREE_HAL_DRIVER_DEFAULTS` and `IREE_TARGET_BACKEND_DEFAULTS` options can be used to set only a specific subset (set to `OFF` by default, then enable just the features you want).
  • Loading branch information
ScottTodd authored Dec 22, 2021
1 parent 97982ec commit d1620f0
Show file tree
Hide file tree
Showing 27 changed files with 124 additions and 144 deletions.
130 changes: 50 additions & 80 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ option(IREE_BUILD_TENSORFLOW_COMPILER "Builds TensorFlow compiler frontend." "${
option(IREE_BUILD_TFLITE_COMPILER "Builds the TFLite compiler frontend." "${IREE_BUILD_TENSORFLOW_ALL}")
option(IREE_BUILD_XLA_COMPILER "Builds TensorFlow XLA compiler frontend." "${IREE_BUILD_TENSORFLOW_ALL}")

set(IREE_HAL_DRIVERS_TO_BUILD "default"
CACHE STRING "Semicolon-separated list of HAL drivers to build, or \"default\"")
set(IREE_TARGET_BACKENDS_TO_BUILD "default"
CACHE STRING "Semicolon-separated list of target backends to build, or \"default\"")

# Properties controlling version and naming of release artifacts.
set(IREE_RELEASE_PACKAGE_SUFFIX "-dev" CACHE STRING "Suffix to append to distributed package names")
set(IREE_RELEASE_VERSION "0.1a1" CACHE STRING "Version to embed in distributed packages")
Expand Down Expand Up @@ -90,86 +85,56 @@ option(IREE_ENABLE_EMITC "Enables MLIR EmitC dependencies." ${IREE_BUILD_COMPILE
# Target and backend configuration
#-------------------------------------------------------------------------------

# List of all runtime HAL drivers included in the project:
set(IREE_ALL_HAL_DRIVERS
CUDA
Dylib
Dylib_Sync
VMVX
VMVX_Sync
Vulkan
)

if(IREE_HAL_DRIVERS_TO_BUILD STREQUAL "default")
set(IREE_HAL_DRIVERS_TO_BUILD ${IREE_ALL_HAL_DRIVERS})
option(IREE_HAL_DRIVER_DEFAULTS "Sets the default value for all runtime HAL drivers" ON)
option(IREE_TARGET_BACKEND_DEFAULTS "Sets the default value for all compiler target backends" ${IREE_BUILD_COMPILER})

# Vulkan is not natively supported on Apple platforms.
# Metal should generally be used instead, though MoltenVK may also work.
if(APPLE)
list(REMOVE_ITEM IREE_HAL_DRIVERS_TO_BUILD Vulkan)
endif()

# CUDA is not natively supported on Android or Apple platforms.
if(ANDROID OR APPLE)
list(REMOVE_ITEM IREE_HAL_DRIVERS_TO_BUILD CUDA)
endif()
# CUDA is not natively supported on Android or Apple platforms.
if(ANDROID OR APPLE)
set(IREE_HAL_DRIVER_CUDA_DEFAULT OFF)
else()
set(IREE_HAL_DRIVER_CUDA_DEFAULT ${IREE_HAL_DRIVER_DEFAULTS})
endif()
message(STATUS "Building runtime HAL drivers: ${IREE_HAL_DRIVERS_TO_BUILD}")

# Start each IREE_HAL_DRIVER_* OFF, then enable from IREE_HAL_DRIVERS_TO_BUILD.
foreach(_backend ${IREE_ALL_HAL_DRIVERS})
string(TOUPPER "${_backend}" uppercase_backend)
set(IREE_HAL_DRIVER_${uppercase_backend} OFF CACHE BOOL "" FORCE)
endforeach()
foreach(_backend ${IREE_HAL_DRIVERS_TO_BUILD})
string(TOUPPER "${_backend}" uppercase_backend)
string(REPLACE "\"" "" uppercase_backend ${uppercase_backend})
set(IREE_HAL_DRIVER_${uppercase_backend} ON CACHE BOOL "" FORCE)
endforeach()

# List of all compiler target backends included in the project:
set(IREE_ALL_TARGET_BACKENDS
CUDA
Dylib-LLVM-AOT
WASM-LLVM-AOT
Metal-SPIRV
ROCm
Vulkan-SPIRV
VMVX
WebGPU
)

if(${IREE_BUILD_COMPILER})
if(IREE_TARGET_BACKENDS_TO_BUILD STREQUAL "default")
set(IREE_TARGET_BACKENDS_TO_BUILD ${IREE_ALL_TARGET_BACKENDS})

# Disable the WebGPU backend by default, as it has complex dependencies and
# is still early in its development.
list(REMOVE_ITEM IREE_TARGET_BACKENDS_TO_BUILD WebGPU)
endif()
message(STATUS "Building compiler target backends: ${IREE_TARGET_BACKENDS_TO_BUILD}")
# Vulkan is not natively supported on Apple platforms.
# Metal should generally be used instead, though MoltenVK may also work.
if (APPLE)
set(IREE_HAL_DRIVER_VULKAN_DEFAULT OFF)
else()
set(IREE_TARGET_BACKENDS_TO_BUILD "" CACHE STRING "" FORCE)
message(STATUS "Compiler is disabled, building no target backends")
set(IREE_HAL_DRIVER_VULKAN_DEFAULT ${IREE_HAL_DRIVER_DEFAULTS})
endif()

# Default every IREE_TARGET_BACKEND_* to OFF
foreach(_backend ${IREE_ALL_TARGET_BACKENDS})
string(TOUPPER "${_backend}" uppercase_backend)
set(IREE_TARGET_BACKEND_${uppercase_backend} OFF CACHE BOOL "" FORCE)
endforeach()

# Set IREE_TARGET_BACKEND_* based on configuration
foreach(_backend ${IREE_TARGET_BACKENDS_TO_BUILD})
string(TOUPPER "${_backend}" uppercase_backend)
string(REPLACE "\"" "" uppercase_backend ${uppercase_backend})
set(IREE_TARGET_BACKEND_${uppercase_backend} ON CACHE BOOL "" FORCE)
endforeach()

list(APPEND CMAKE_MODULE_PATH
${CMAKE_CURRENT_LIST_DIR}/build_tools/cmake/
${CMAKE_CURRENT_LIST_DIR}/bindings/python/build_tools/cmake/
)
option(IREE_HAL_DRIVER_CUDA "Enables the 'cuda' runtime HAL driver" ${IREE_HAL_DRIVER_CUDA_DEFAULT})
option(IREE_HAL_DRIVER_DYLIB "Enables the 'dylib' runtime HAL driver" ${IREE_HAL_DRIVER_DEFAULTS})
option(IREE_HAL_DRIVER_DYLIB_SYNC "Enables the 'dylib-sync' runtime HAL driver" ${IREE_HAL_DRIVER_DEFAULTS})
option(IREE_HAL_DRIVER_VMVX "Enables the 'vmvx' runtime HAL driver" ${IREE_HAL_DRIVER_DEFAULTS})
option(IREE_HAL_DRIVER_VMVX_SYNC "Enables the 'vmvx-sync' runtime HAL driver" ${IREE_HAL_DRIVER_DEFAULTS})
option(IREE_HAL_DRIVER_VULKAN "Enables the 'vulkan' runtime HAL driver" ${IREE_HAL_DRIVER_VULKAN_DEFAULT})

option(IREE_TARGET_BACKEND_CUDA "Enables the 'cuda' compiler target backend" ${IREE_BUILD_COMPILER})
option(IREE_TARGET_BACKEND_DYLIB_LLVM_AOT "Enables the 'dylib-llvm-aot' compiler target backend" ${IREE_BUILD_COMPILER})
option(IREE_TARGET_BACKEND_METAL_SPIRV "Enables the 'metal-spirv' compiler target backend" ${IREE_BUILD_COMPILER})
option(IREE_TARGET_BACKEND_ROCM "Enables the 'rocm' compiler target backend" ${IREE_BUILD_COMPILER})
option(IREE_TARGET_BACKEND_VMVX "Enables the 'vmvx' compiler target backend" ${IREE_BUILD_COMPILER})
option(IREE_TARGET_BACKEND_VULKAN_SPIRV "Enables the 'vulkan-spirv' compiler target backend" ${IREE_BUILD_COMPILER})
option(IREE_TARGET_BACKEND_WASM_LLVM_AOT "Enables the 'wasm-llvm-aot' compiler target backend" ${IREE_BUILD_COMPILER})
# Disable WebGPU by default - it has complex deps and is under development.
option(IREE_TARGET_BACKEND_WEBGPU "Enables the 'webgpu' compiler target backend" OFF)

message(VERBOSE "IREE build runtime HAL driver 'cuda': ${IREE_HAL_DRIVER_CUDA}")
message(VERBOSE "IREE build runtime HAL driver 'dylib': ${IREE_HAL_DRIVER_DYLIB}")
message(VERBOSE "IREE build runtime HAL driver 'dylib-sync': ${IREE_HAL_DRIVER_DYLIB_SYNC}")
message(VERBOSE "IREE build runtime HAL driver 'vmvx': ${IREE_HAL_DRIVER_VMVX}")
message(VERBOSE "IREE build runtime HAL driver 'vmvx-sync': ${IREE_HAL_DRIVER_VMVX_SYNC}")
message(VERBOSE "IREE build runtime HAL driver 'vulkan': ${IREE_HAL_DRIVER_VULKAN}")

message(VERBOSE "IREE build compiler target backend 'cuda': ${IREE_TARGET_BACKEND_CUDA}")
message(VERBOSE "IREE build compiler target backend 'dylib-llvm-aot': ${IREE_TARGET_BACKEND_DYLIB_LLVM_AOT}")
message(VERBOSE "IREE build compiler target backend 'wasm-llvm-aot': ${IREE_TARGET_BACKEND_WASM_LLVM_AOT}")
message(VERBOSE "IREE build compiler target backend 'metal-spirv': ${IREE_TARGET_BACKEND_METAL_SPIRV}")
message(VERBOSE "IREE build compiler target backend 'rocm': ${IREE_TARGET_BACKEND_ROCM}")
message(VERBOSE "IREE build compiler target backend 'vulkan-spirv': ${IREE_TARGET_BACKEND_VULKAN_SPIRV}")
message(VERBOSE "IREE build compiler target backend 'vmvx': ${IREE_TARGET_BACKEND_VMVX}")
message(VERBOSE "IREE build compiler target backend 'webgpu': ${IREE_TARGET_BACKEND_WEBGPU}")

#-------------------------------------------------------------------------------
# IREE compilation toolchain configuration
Expand Down Expand Up @@ -244,6 +209,11 @@ iree_fix_ndebug()
# IREE utility definitions
#-------------------------------------------------------------------------------

list(APPEND CMAKE_MODULE_PATH
${CMAKE_CURRENT_LIST_DIR}/build_tools/cmake/
${CMAKE_CURRENT_LIST_DIR}/bindings/python/build_tools/cmake/
)

include(iree_macros)
include(iree_copts)
include(sanitizers)
Expand Down Expand Up @@ -479,7 +449,7 @@ if(IREE_BUILD_PYTHON_BINDINGS)
endif()
endif()

if(IREE_TARGET_BACKEND_METAL-SPIRV)
if(IREE_TARGET_BACKEND_METAL_SPIRV)
iree_set_spirv_cross_cmake_options()
# SPIRV-Cross is needed to cross compile SPIR-V into MSL source code.
add_subdirectory(third_party/spirv_cross EXCLUDE_FROM_ALL)
Expand Down
7 changes: 4 additions & 3 deletions bindings/tflite/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ android {
cmake {
arguments "-DIREE_BUILD_BINDINGS_TFLITE=ON",
"-DIREE_BUILD_BINDINGS_TFLITE_JAVA=ON",
"-DIREE_HAL_DRIVERS_TO_BUILD=VMVX",
"-DIREE_HAL_DRIVER_DEFAULTS=OFF",
"-DIREE_HAL_DRIVER_VMVX=ON",

// Disable all but the runtime components needed for the
// java bindings.
Expand Down Expand Up @@ -79,8 +80,8 @@ task cmakeConfigureHost(type: Exec) {
commandLine "cmake",
"-G" , "Ninja",
"-B", hostBuildDir ,
"-DIREE_TARGET_BACKENDS_TO_BUILD=vmvx",
"-DIREE_HAL_DRIVERS_TO_BUILD=vmvx",
"-DIREE_HAL_DRIVER_DEFAULTS=OFF",
"-DIREE_HAL_DRIVER_VMVX=ON",
"-DIREE_BUILD_COMPILER=OFF",
"-DIREE_BUILD_TESTS=OFF ",
"-DIREE_BUILD_SAMPLES=OFF",
Expand Down
3 changes: 2 additions & 1 deletion build_tools/cmake/build_runtime_emscripten.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ cd build-emscripten
# Configure using Emscripten's CMake wrapper, then build.
emcmake "${CMAKE_BIN?}" -G Ninja .. \
-DIREE_HOST_BINARY_ROOT=$PWD/../build-host/install \
-DIREE_HAL_DRIVERS_TO_BUILD=VMVX\;DyLib \
-DIREE_HAL_DRIVER_DEFAULTS=OFF \
-DIREE_HAL_DRIVER_VMVX=ON \
-DIREE_BUILD_COMPILER=OFF \
-DIREE_BUILD_TESTS=OFF \
-DIREE_BUILD_SAMPLES=ON
Expand Down
14 changes: 8 additions & 6 deletions build_tools/cmake/iree_check_test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,17 @@ function(iree_check_single_backend_test_suite)
# Omit tests for which the specified driver or target backend is not enabled.
# This overlaps with directory exclusions and other filtering mechanisms.
string(TOUPPER ${_RULE_DRIVER} _UPPERCASE_DRIVER)
if(NOT DEFINED IREE_HAL_DRIVER_${_UPPERCASE_DRIVER})
message(SEND_ERROR "Unknown driver '${_RULE_DRIVER}'. Check IREE_ALL_HAL_DRIVERS.")
string(REPLACE "-" "_" _NORMALIZED_DRIVER ${_UPPERCASE_DRIVER})
if(NOT DEFINED IREE_HAL_DRIVER_${_NORMALIZED_DRIVER})
message(SEND_ERROR "Unknown driver '${_RULE_DRIVER}'. Check IREE_HAL_DRIVER_* options.")
endif()
if(NOT IREE_HAL_DRIVER_${_UPPERCASE_DRIVER})
if(NOT IREE_HAL_DRIVER_${_NORMALIZED_DRIVER})
return()
endif()
string(TOUPPER ${_RULE_TARGET_BACKEND} _UPPERCASE_TARGET_BACKEND)
if(NOT DEFINED IREE_TARGET_BACKEND_${_UPPERCASE_TARGET_BACKEND})
message(SEND_ERROR "Unknown backend '${_RULE_TARGET_BACKEND}'. Check IREE_ALL_TARGET_BACKENDS.")
string(REPLACE "-" "_" _NORMALIZED_TARGET_BACKEND ${_UPPERCASE_TARGET_BACKEND})
if(NOT DEFINED IREE_TARGET_BACKEND_${_NORMALIZED_TARGET_BACKEND})
message(SEND_ERROR "Unknown backend '${_RULE_TARGET_BACKEND}'. Check IREE_TARGET_BACKEND_* options.")
endif()
if(DEFINED IREE_HOST_BINARY_ROOT)
# If we're not building the host tools from source under this configuration,
Expand All @@ -240,7 +242,7 @@ function(iree_check_single_backend_test_suite)
# rely on the runtime HAL driver check above for filtering.
else()
# We are building the host tools, so check enabled compiler target backends.
if(NOT IREE_TARGET_BACKEND_${_UPPERCASE_TARGET_BACKEND})
if(NOT IREE_TARGET_BACKEND_${_NORMALIZED_TARGET_BACKEND})
return()
endif()
endif()
Expand Down
4 changes: 2 additions & 2 deletions build_tools/cmake/iree_macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,10 @@ function(iree_add_test_environment_properties TEST_NAME)
#
# Tests which only depend on a compiler target backend or a runtime HAL
# driver, but not both, should generally use a different method of filtering.
if(NOT "${IREE_TARGET_BACKEND_VULKAN-SPIRV}" OR NOT "${IREE_HAL_DRIVER_VULKAN}")
if(NOT "${IREE_TARGET_BACKEND_VULKAN_SPIRV}" OR NOT "${IREE_HAL_DRIVER_VULKAN}")
set_property(TEST ${TEST_NAME} APPEND PROPERTY ENVIRONMENT "IREE_VULKAN_DISABLE=1")
endif()
if(NOT "${IREE_TARGET_BACKEND_DYLIB-LLVM-AOT}" OR NOT "${IREE_HAL_DRIVER_DYLIB}"
if(NOT "${IREE_TARGET_BACKEND_DYLIB_LLVM_AOT}" OR NOT "${IREE_HAL_DRIVER_DYLIB}"
OR NOT "${IREE_HAL_DRIVER_DYLIB_SYNC}")
set_property(TEST ${TEST_NAME} APPEND PROPERTY ENVIRONMENT "IREE_LLVMAOT_DISABLE=1")
endif()
Expand Down
14 changes: 8 additions & 6 deletions build_tools/cmake/iree_trace_runner_test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,17 @@ function(iree_single_backend_generated_trace_runner_test)
# Omit tests for which the specified driver or target backend is not enabled.
# This overlaps with directory exclusions and other filtering mechanisms.
string(TOUPPER ${_RULE_DRIVER} _UPPERCASE_DRIVER)
if(NOT DEFINED IREE_HAL_DRIVER_${_UPPERCASE_DRIVER})
message(SEND_ERROR "Unknown driver '${_RULE_DRIVER}'. Check IREE_ALL_HAL_DRIVERS.")
string(REPLACE "-" "_" _NORMALIZED_DRIVER ${_UPPERCASE_DRIVER})
if(NOT DEFINED IREE_HAL_DRIVER_${_NORMALIZED_DRIVER})
message(SEND_ERROR "Unknown driver '${_RULE_DRIVER}'. Check IREE_HAL_DRIVER_* options.")
endif()
if(NOT IREE_HAL_DRIVER_${_UPPERCASE_DRIVER})
if(NOT IREE_HAL_DRIVER_${_NORMALIZED_DRIVER})
return()
endif()
string(TOUPPER ${_RULE_TARGET_BACKEND} _UPPERCASE_TARGET_BACKEND)
if(NOT DEFINED IREE_TARGET_BACKEND_${_UPPERCASE_TARGET_BACKEND})
message(SEND_ERROR "Unknown backend '${_RULE_TARGET_BACKEND}'. Check IREE_ALL_TARGET_BACKENDS.")
string(REPLACE "-" "_" _NORMALIZED_TARGET_BACKEND ${_UPPERCASE_TARGET_BACKEND})
if(NOT DEFINED IREE_TARGET_BACKEND_${_NORMALIZED_TARGET_BACKEND})
message(SEND_ERROR "Unknown backend '${_RULE_TARGET_BACKEND}'. Check IREE_TARGET_BACKEND_* options.")
endif()
if(DEFINED IREE_HOST_BINARY_ROOT)
# If we're not building the host tools from source under this configuration,
Expand All @@ -183,7 +185,7 @@ function(iree_single_backend_generated_trace_runner_test)
# rely on the runtime HAL driver check above for filtering.
else()
# We are building the host tools, so check enabled compiler target backends.
if(NOT IREE_TARGET_BACKEND_${_UPPERCASE_TARGET_BACKEND})
if(NOT IREE_TARGET_BACKEND_${_NORMALIZED_TARGET_BACKEND})
return()
endif()
endif()
Expand Down
4 changes: 3 additions & 1 deletion build_tools/cmake/riscv.toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ elseif(RISCV_CPU STREQUAL "rv32-baremetal")
set(CMAKE_C_EXTENSIONS OFF) # Force the usage of _ISOC11_SOURCE
set(IREE_BUILD_BINDINGS_TFLITE OFF CACHE BOOL "" FORCE)
set(IREE_BUILD_BINDINGS_TFLITE_JAVA OFF CACHE BOOL "" FORCE)
set(IREE_HAL_DRIVERS_TO_BUILD "Dylib_sync;VMVX_sync" CACHE STRING "" FORCE)
set(IREE_HAL_DRIVER_DEFAULTS OFF CACHE BOOL "" FORCE)
set(IREE_HAL_DRIVER_VMVX_SYNC ON CACHE BOOL "" FORCE)
set(IREE_HAL_DRIVER_DYLIB_SYNC ON CACHE BOOL "" FORCE)
set(CMAKE_SYSTEM_LIBRARY_PATH "${RISCV_TOOLCHAIN_ROOT}/riscv32-unknown-elf/lib")
set(IREE_ENABLE_THREADING OFF CACHE BOOL "" FORCE)
set(RISCV_COMPILER_FLAGS "${RISCV_COMPILER_FLAGS} -march=rv32imf -mabi=ilp32 -DIREE_PLATFORM_GENERIC=1 -DIREE_SYNCHRONIZATION_DISABLE_UNSAFE=1 \
Expand Down
21 changes: 12 additions & 9 deletions docs/developers/get_started/cmake_options_and_variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,21 @@ Builds the IREE TFLite Java bindings with the C API compatibility shim. Defaults

Builds experimental remoting component. Defaults to `OFF`.

#### `IREE_HAL_DRIVERS_TO_BUILD`:STRING
#### `IREE_HAL_DRIVER_DEFAULTS`:BOOL

Semicolon-separated list of HAL drivers to build, or `all` for building all HAL
drivers. Case-insensitive. If an empty list is provided, will build no HAL
drivers. Defaults to `all`. Example: `-DIREE_HAL_DRIVERS_TO_BUILD=Vulkan;VMLA`.
Default setting for each `IREE_HAL_DRIVER_*` option.

#### `IREE_TARGET_BACKENDS_TO_BUILD`:STRING
#### `IREE_HAL_DRIVER_*`:BOOL

Semicolon-separated list of target backend to build, or `all` for building all
compiler target backends. Case-insensitive. If an empty list is provided, will
build no target backends. Defaults to `all`. Example:
`-DIREE_TARGET_BACKENDS_TO_BUILD=Vulkan-SPIRV;VMLA`.
Individual options enabling the build for each runtime HAL driver.

#### `IREE_TARGET_BACKEND_DEFAULTS`:BOOL

Default setting for each `IREE_TARGET_BACKEND_*` option.

#### `IREE_TARGET_BACKEND_*`:BOOL

Individual options enabling the build for each compiler target backend.

#### `IREE_DEV_MODE`:BOOL

Expand Down
5 changes: 3 additions & 2 deletions docs/website/docs/deployment-configurations/bare-metal.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ model execution is in a single-thread synchronous fashion.
operating system
* `set(IREE_BINDINGS_TFLITE OFF)`: Disable the TFLite binding support
* `set(IREE_ENABLE_THREADING OFF)`: Disable multi-thread library support
* `set(IREE_HAL_DRIVERS_TO_BUILD "Dylib_Sync;VMVX_Sync")`: Build only the
dynamic library and VMVX runtime synchronous HAL drivers
* `set(IREE_HAL_DRIVER_DEFAULTS OFF)`: Disable HAL drivers by default, then
enable the synchronous HAL drivers with `set(IREE_HAL_DRIVER_VMVX_SYNC ON)` and
`set(IREE_HAL_DRIVER_DYLIB_SYNC ON)`
* `set(IREE_BUILD_TESTS OFF)`: Disable tests until IREE supports running them on
bare-metal platforms
* `set(IREE_BUILD_SAMPLES ON)`: Build
Expand Down
10 changes: 4 additions & 6 deletions docs/website/docs/deployment-configurations/cpu-dylib.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ in by default on all platforms.

<!-- TODO(??): a way to verify dylib is compiled in and supported -->

If you want to explicitly specify HAL drivers to support, you will need to add
`DyLib` to the `IREE_HAL_DRIVERS_TO_BUILD` CMake list variable when configuring
(for target).
Ensure that the `IREE_HAL_DRIVER_DYLIB` CMake option is `ON` when configuring
for the target.

### Get compiler for CPU native instructions

Expand Down Expand Up @@ -69,9 +68,8 @@ to build IREE for your host platform and the
page if you are cross compiling for Android. The dylib compiler backend is
compiled in by default on all platforms.

If you want to explicitly specify HAL drivers to support, you will need to add
`DYLIB-LLVM-AOT` to the `IREE_TARGET_BACKENDS_TO_BUILD` CMake list variable when
configuring (for host).
Ensure that the `IREE_TARGET_BACKEND_DYLIB_LLVM_AOT` CMake option is `ON` when
configuring for the host.

## Compile and run the model

Expand Down
10 changes: 4 additions & 6 deletions docs/website/docs/deployment-configurations/gpu-vulkan.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,8 @@ platforms.

<!-- TODO(??): a way to verify Vulkan is compiled in and supported -->

If you want to explicitly specify HAL drivers to support, you will need to add
`Vulkan` to the `IREE_HAL_DRIVERS_TO_BUILD` CMake list variable when
configuring (for target).
Ensure that the `IREE_HAL_DRIVER_VULKAN` CMake option is `ON` when configuring
for the target.

### Get compiler for SPIR-V exchange format

Expand Down Expand Up @@ -120,9 +119,8 @@ to build IREE for Linux/Windows and the [Android cross-compilation][android-cc]
page for Android. The SPIR-V compiler backend is compiled in by default on all
platforms.

If you want to explicitly specify HAL drivers to support, you will need to add
`Vulkan-SPIRV` to the `IREE_TARGET_BACKENDS_TO_BUILD` CMake list variable when
configuring (for host).
Ensure that the `IREE_TARGET_BACKEND_VULKAN_SPIRV` CMake option is `ON` when
configuring for the host.

## Compile and run the model

Expand Down
2 changes: 1 addition & 1 deletion iree/compiler/Dialect/HAL/Target/LLVM/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ package(

iree_cmake_extra_content(
content = """
if(NOT "${IREE_TARGET_BACKEND_DYLIB-LLVM-AOT}" AND NOT "${IREE_TARGET_BACKEND_WASM-LLVM-AOT}")
if(NOT "${IREE_TARGET_BACKEND_DYLIB_LLVM_AOT}" AND NOT "${IREE_TARGET_BACKEND_WASM_LLVM_AOT}")
return()
endif()
""",
Expand Down
2 changes: 1 addition & 1 deletion iree/compiler/Dialect/HAL/Target/LLVM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# To disable autogeneration for this file entirely, delete this header. #
################################################################################

if(NOT "${IREE_TARGET_BACKEND_DYLIB-LLVM-AOT}" AND NOT "${IREE_TARGET_BACKEND_WASM-LLVM-AOT}")
if(NOT "${IREE_TARGET_BACKEND_DYLIB_LLVM_AOT}" AND NOT "${IREE_TARGET_BACKEND_WASM_LLVM_AOT}")
return()
endif()

Expand Down
Loading

0 comments on commit d1620f0

Please sign in to comment.