[ROCm] add CMake options to specify additional compile arguments for conformance tests
diff --git a/experimental/rocm/CMakeLists.txt b/experimental/rocm/CMakeLists.txt
index d157437..4f1dfa3 100644
--- a/experimental/rocm/CMakeLists.txt
+++ b/experimental/rocm/CMakeLists.txt
@@ -12,6 +12,16 @@
   OUTPUT_VARIABLE IREE_PACKAGE_ROOT_DIR)
 set(IREE_PACKAGE_ROOT_PREFIX iree)
 
+set(IREE_ROCM_TARGET_CHIP_DEFAULT "gfx908")
+set(IREE_ROCM_TARGET_CHIP "${IREE_ROCM_TARGET_CHIP_DEFAULT}" CACHE STRING
+  "Target chip for ROCm. This influences conformance tests that need to compile device code. Defaults to \"${IREE_ROCM_TARGET_CHIP_DEFAULT}\".")
+set(IREE_ROCM_LINK_BC_DEFAULT OFF)
+set(IREE_ROCM_LINK_BC ${IREE_ROCM_LINK_BC_DEFAULT} CACHE BOOL
+  "Whether to try Linking to AMD Bitcodes. This influences conformance tests that need to compile device code. Defaults to ${IREE_ROCM_LINK_BC}.")
+set(IREE_ROCM_BC_DIR_DEFAULT "/opt/rocm/amdgcn/bitcode")
+set(IREE_ROCM_BC_DIR "${IREE_ROCM_BC_DIR_DEFAULT}" CACHE STRING
+  "Directory of ROCM Bitcode. This influences conformance tests that need to compile device code. Defaults to \"${IREE_ROCM_TARGET_CHIP_DEFAULT}\".")
+
 iree_add_all_subdirs()
 
 if(NOT ROCM_HEADERS_API_ROOT)
diff --git a/experimental/rocm/cts/CMakeLists.txt b/experimental/rocm/cts/CMakeLists.txt
index 7ee3c3a..d9ffd1b 100644
--- a/experimental/rocm/cts/CMakeLists.txt
+++ b/experimental/rocm/cts/CMakeLists.txt
@@ -4,6 +4,16 @@
 # See https://llvm.org/LICENSE.txt for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
+unset(COMPILER_FLAGS)
+if(IREE_ROCM_LINK_BC)
+  list(APPEND COMPILER_FLAGS "--iree-rocm-link-bc=true")
+else()
+  list(APPEND COMPILER_FLAGS "--iree-rocm-link-bc=false")
+endif()
+list(APPEND COMPILER_FLAGS
+  "--iree-rocm-target-chip=${IREE_ROCM_TARGET_CHIP}"
+  "--iree-rocm-bc-dir=${IREE_ROCM_BC_DIR}")
+
 iree_hal_cts_test_suite(
   DRIVER_NAME
     rocm
@@ -15,6 +25,8 @@
     "rocm"
   EXECUTABLE_FORMAT
     "\"PTXE\""
+  COMPILER_FLAGS
+    ${COMPILER_FLAGS}
   DEPS
     iree::experimental::rocm::registration
   EXCLUDED_TESTS