diff --git a/mlir/tools/mlir-cuda-runner/CMakeLists.txt b/mlir/tools/mlir-cuda-runner/CMakeLists.txt --- a/mlir/tools/mlir-cuda-runner/CMakeLists.txt +++ b/mlir/tools/mlir-cuda-runner/CMakeLists.txt @@ -27,16 +27,18 @@ # We need the libcuda.so library. find_library(CUDA_RUNTIME_LIBRARY cuda) - add_llvm_library(cuda-runtime-wrappers SHARED + add_mlir_library(cuda-runtime-wrappers + SHARED cuda-runtime-wrappers.cpp + + EXCLUDE_FROM_LIBMLIR ) target_include_directories(cuda-runtime-wrappers - PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES} - LLVMSupport + PRIVATE + ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES} ) target_link_libraries(cuda-runtime-wrappers - PUBLIC - LLVMSupport + PRIVATE ${CUDA_RUNTIME_LIBRARY} ) diff --git a/mlir/tools/mlir-cuda-runner/cuda-runtime-wrappers.cpp b/mlir/tools/mlir-cuda-runner/cuda-runtime-wrappers.cpp --- a/mlir/tools/mlir-cuda-runner/cuda-runtime-wrappers.cpp +++ b/mlir/tools/mlir-cuda-runner/cuda-runtime-wrappers.cpp @@ -17,7 +17,6 @@ #include "mlir/ExecutionEngine/CRunnerUtils.h" #include "llvm/ADT/ArrayRef.h" -#include "llvm/Support/raw_ostream.h" #include "cuda.h" @@ -29,7 +28,7 @@ cuGetErrorName(result, &name); \ if (!name) \ name = ""; \ - llvm::errs() << "'" << #expr << "' failed with '" << name << "'\n"; \ + fprintf(stderr, "'%s' failed with '%s'\n", #expr, name); \ }(expr) // Static reference to CUDA primary context for device ordinal 0. diff --git a/mlir/tools/mlir-rocm-runner/CMakeLists.txt b/mlir/tools/mlir-rocm-runner/CMakeLists.txt --- a/mlir/tools/mlir-rocm-runner/CMakeLists.txt +++ b/mlir/tools/mlir-rocm-runner/CMakeLists.txt @@ -49,18 +49,19 @@ # Set HIP compile-time flags. add_definitions(-D__HIP_PLATFORM_HCC__) - add_llvm_library(rocm-runtime-wrappers SHARED + add_mlir_library(rocm-runtime-wrappers + SHARED rocm-runtime-wrappers.cpp + + EXCLUDE_FROM_LIBMLIR ) target_include_directories(rocm-runtime-wrappers PRIVATE "${HIP_PATH}/../include" "${HIP_PATH}/include" - LLVMSupport ) target_link_libraries(rocm-runtime-wrappers - PUBLIC - LLVMSupport + PRIVATE ${ROCM_RUNTIME_LIBRARY} ) diff --git a/mlir/tools/mlir-rocm-runner/rocm-runtime-wrappers.cpp b/mlir/tools/mlir-rocm-runner/rocm-runtime-wrappers.cpp --- a/mlir/tools/mlir-rocm-runner/rocm-runtime-wrappers.cpp +++ b/mlir/tools/mlir-rocm-runner/rocm-runtime-wrappers.cpp @@ -17,7 +17,6 @@ #include "mlir/ExecutionEngine/CRunnerUtils.h" #include "llvm/ADT/ArrayRef.h" -#include "llvm/Support/raw_ostream.h" #include "hip/hip_runtime.h" @@ -28,7 +27,7 @@ const char *name = hipGetErrorName(result); \ if (!name) \ name = ""; \ - llvm::errs() << "'" << #expr << "' failed with '" << name << "'\n"; \ + fprintf(stderr, "'%s' failed with '%s'\n", #expr, name); \ }(expr) // Static reference to HIP primary context for device ordinal 0.