Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ set(ROCMLIR_DRIVER_RANDOM_DATA_SEED "none" CACHE STRING "Enable E2E tests using
set(ROCMLIR_GEN_FLAGS "" CACHE BOOL "Set feature flag for rocmlir-gen")
set(ROCMLIR_DRIVER_TEST_GPU_VALIDATION 1 CACHE BOOL "Enable E2E tests with GPU validation")
set(ROCK_E2E_TEST_ENABLED 0 CACHE BOOL "Enable build rock E2E tests")
option(ROCMLIR_BUILD_TUNING_DRIVER "Build rocmlir-tuning-driver (default ON when BUILD_FAT_LIBROCKCOMPILER)" OFF)
set(ROCMLIR_ENABLE_BENCHMARKS "" CACHE STRING "List of enabled benchmarks")

set(ROCMLIR_BIN_DIR "${CMAKE_CURRENT_BINARY_DIR}/bin" CACHE PATH "")
Expand All @@ -81,6 +82,8 @@ if( BUILD_FAT_LIBROCKCOMPILER )
set(LLVM_BUILD_LLVM_DYLIB OFF CACHE BOOL "")
# rocm-runner is not supported with static libraries
set(MLIR_ENABLE_ROCM_RUNNER 0 CACHE BOOL "")
# Enable tuning driver by default for fat-lib builds (it can link against static dialect libs + shared HIP)
set(ROCMLIR_BUILD_TUNING_DRIVER ON CACHE BOOL "" FORCE)
set(MLIR_INCLUDE_INTEGRATION_TESTS OFF CACHE BOOL "")
set(ROCMLIR_DRIVER_PR_E2E_TEST_ENABLED 0 CACHE BOOL "Enable build PR-triggered E2E tests for Rock driver")
set(MHAL_ENABLE_HOST_RUNNER OFF CACHE BOOL "Enable MHAL host runner")
Expand Down
4 changes: 4 additions & 0 deletions mlir/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ if(MLIR_ENABLE_ROCM_RUNNER)
rocmlir-tuning-driver
)
endif()
# When building tuning driver without rocm-runner (e.g. fat-lib), ensure it is built before tests
if(ROCMLIR_BUILD_TUNING_DRIVER)
list(APPEND ROCMLIR_TEST_DEPENDS rocmlir-tuning-driver)
endif()

if(MLIR_BINDINGS_PYTHON_ENABLED)
list(APPEND ROCMLIR_TEST_DEPENDS
Expand Down
6 changes: 4 additions & 2 deletions mlir/tools/rocmlir-tuning-driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ set(LLVM_OPTIONAL_SOURCES
rocmlir-tuning-driver.cpp
)

if(MLIR_ENABLE_ROCM_RUNNER)
if(MLIR_ENABLE_ROCM_RUNNER OR ROCMLIR_BUILD_TUNING_DRIVER)

get_property(rocmlir_dialect_libs GLOBAL PROPERTY ROCMLIR_DIALECT_LIBS)
get_property(rocmlir_conversion_libs GLOBAL PROPERTY ROCMLIR_CONVERSION_LIBS)
Expand Down Expand Up @@ -37,7 +37,8 @@ find_package(hip REQUIRED)
find_package(hiprtc REQUIRED)
set(CMAKE_PREFIX_PATH "${REAL_CMAKE_PREFIX_PATH}")

# Supress compiler warnings from HIP headers
# Suppress compiler warnings from HIP headers (only when rocm runner is built)
if(MLIR_ENABLE_ROCM_RUNNER)
check_cxx_compiler_flag(-Wno-c++98-compat-extra-semi
CXX_SUPPORTS_NO_CXX98_COMPAT_EXTRA_SEMI_FLAG)
if (CXX_SUPPORTS_CXX98_COMPAT_EXTRA_SEMI_FLAG)
Expand All @@ -62,6 +63,7 @@ if (CXX_SUPPORTS_WNO_GNU_ANONYMOUS_STRUCT_FLAG)
target_compile_options(mlir_rocm_runtime PRIVATE
"-Wno-gnu-anonymous-struct")
endif()
endif()

set_property(TARGET rocmlir-tuning-driver
PROPERTY INSTALL_RPATH_USE_LINK_PATH ON)
Expand Down
3 changes: 2 additions & 1 deletion mlir/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# subdirectory leads to static library builds trying to find HIP, which
# has caused fatal CMake errors in cases where ROCm is only partially
# installed.
if (MLIR_ENABLE_ROCM_RUNNER)
# ROCMLIR_BUILD_TUNING_DRIVER also needs performance/common for benchmark-driver-utils.
if (MLIR_ENABLE_ROCM_RUNNER OR ROCMLIR_BUILD_TUNING_DRIVER)
add_subdirectory(performance)
endif()