diff --git a/CMakeLists.txt b/CMakeLists.txt index 7603dd57789d9..06cc6f3c9cf7f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -364,6 +364,10 @@ cmake_dependent_option(IREE_TARGET_BACKEND_VULKAN_SPIRV "Enables the 'vulkan-spi # Default target backends that are not yet fully supported but are being brought up. cmake_dependent_option(IREE_TARGET_BACKEND_ROCM "Enables the 'rocm' compiler target backend" ${IREE_TARGET_BACKEND_DEFAULTS} ${IREE_BUILD_COMPILER} OFF) +set(CMAKE_CXX_FLAGS_FASTBUILD "-gmlt" CACHE STRING "Flags used by the C++ compiler during fast builds." FORCE) +set(IREE_ROCM_PATH_DEFAULT "/opt/rocm") +set(IREE_ROCM_PATH "${IREE_ROCM_PATH_DEFAULT}" CACHE STRING "Path to ROCm installation.") + # Supported default target backends that are only available on certain # platforms. set(IREE_TARGET_BACKEND_CUDA_DEFAULT ${IREE_TARGET_BACKEND_DEFAULTS}) diff --git a/compiler/plugins/target/ROCM/builtins/ukernel/CMakeLists.txt b/compiler/plugins/target/ROCM/builtins/ukernel/CMakeLists.txt index 92135e527cafd..34dc9fc7cc9b0 100644 --- a/compiler/plugins/target/ROCM/builtins/ukernel/CMakeLists.txt +++ b/compiler/plugins/target/ROCM/builtins/ukernel/CMakeLists.txt @@ -10,9 +10,6 @@ endif() # Check if HIP is installed on system. # HIP is required to compile ukernels. # TODO: We can do better than this and ensure that headers are always available. -if (NOT IREE_ROCM_PATH) - set(IREE_ROCM_PATH "/opt/rocm") -endif() set (IREE_ROCM_VERSION "${IREE_ROCM_PATH}/.info/version") if (NOT EXISTS ${IREE_ROCM_VERSION}) message(STATUS @@ -57,6 +54,7 @@ function(iree_rocm_bitcode_library) # Suppress warnings about missing path to rocm lib, # and benign warning about ROCM version. "-nogpulib" + "--rocm-path=${IREE_ROCM_PATH}" "-D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH" # Avoid error caused by clang bundling. "--offload-device-only"