This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Make cuda/rocm-runtime-wrappers not depend on LLVMSupport.
ClosedPublic

Authored by csigg on Jan 28 2021, 6:29 AM.

Details

Summary

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.

Diff Detail

Event Timeline

csigg created this revision.Jan 28 2021, 6:29 AM
csigg requested review of this revision.Jan 28 2021, 6:29 AM
csigg edited the summary of this revision. (Show Details)Jan 28 2021, 7:36 AM
herhut accepted this revision.Jan 28 2021, 7:43 AM

We discussed this offline. Given that this is only used in testing, this is the easiest solution to get it working.

This revision is now accepted and ready to land.Jan 28 2021, 7:43 AM