[all-commits] [llvm/llvm-project] 5bdc77: [mlir] Make cuda/rocm-runtime-wrappers not depend ...

Christian Sigg via All-commits all-commits at lists.llvm.org
Thu Jan 28 08:25:30 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5bdc771fc97ed752af42562c33a18c3ea28b098e
      https://github.com/llvm/llvm-project/commit/5bdc771fc97ed752af42562c33a18c3ea28b098e
  Author: Christian Sigg <csigg at google.com>
  Date:   2021-01-28 (Thu, 28 Jan 2021)

  Changed paths:
    M mlir/tools/mlir-cuda-runner/CMakeLists.txt
    M mlir/tools/mlir-cuda-runner/cuda-runtime-wrappers.cpp
    M mlir/tools/mlir-rocm-runner/CMakeLists.txt
    M mlir/tools/mlir-rocm-runner/rocm-runtime-wrappers.cpp

  Log Message:
  -----------
  [mlir] Make cuda/rocm-runtime-wrappers not depend on LLVMSupport.

Depending on the headers only is fine, but we do not want to use any symbols from LLVMSupport. If we do, static registration of cl options is linked in as well, and loading multiple such libraries in the cuda/rocm-runner fails because the same cl options are registered multiple times.

The cuda/rocm-runners also depend on LLVMSupport, so one could think that already loading a single such library would fail. It does not because the map of cl options is not shared between the runner and the loaded libraries (but it is shared across all loaded libraries, presumably because it has external linkage, in contrast to the static registration which has internal linkage).

This change is a preparation step for dynamically loading the mlir_async_runtime.so and cuda-runtime-wrappers.so in the same test. The async runtime depends on LLVMSupport in a more fundamental way (llvm::ThreadPool), and as explained above there can only be one.

This change also switches to add_mlir_library to make it consistent with the other runner_utils libraries.

Reviewed By: herhut

Differential Revision: https://reviews.llvm.org/D95613




More information about the All-commits mailing list