[all-commits] [llvm/llvm-project] b7d800: Fix namespace for MLIR Async Runtime

Matthew Parkinson via All-commits all-commits at lists.llvm.org
Tue Feb 2 11:18:15 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b7d80058ff4649d1a15ef930269458dbb17145d9
      https://github.com/llvm/llvm-project/commit/b7d80058ff4649d1a15ef930269458dbb17145d9
  Author: Matthew Parkinson <mattpark at microsoft.com>
  Date:   2021-02-02 (Tue, 02 Feb 2021)

  Changed paths:
    M mlir/include/mlir/ExecutionEngine/AsyncRuntime.h
    M mlir/lib/ExecutionEngine/AsyncRuntime.cpp

  Log Message:
  -----------
  Fix namespace for MLIR Async Runtime

The MLIR Async runtime uses different namespacing for the header file,
and the definitions of its C API. The header file places the extern "C"
functions inside namespace mlir::runtime, and the definitions are not
in a namespace. This causes issues in cl.exe. It treats the declaration
and definition as different, and thus does not apply dllexport to the
definition, which leads to the mlir_async_runtime.dll containing no
definitions, and the mlir_async_runtime.lib not being generated.

This patch moves the namespace to cover the definitions, and thus
generates the dll correctly on Windows with cl.exe.

This was tested with Visual Studio C++ 19.28.29336.

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




More information about the All-commits mailing list