mirror of
https://github.com/zama-ai/concrete.git
synced 2026-01-09 12:57:55 -05:00
fix(common): fix llvm symbol clash with torch dyn lib
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
// Part of the Concrete Compiler Project, under the BSD3 License with Zama
|
||||
// Exceptions. See
|
||||
// https://github.com/zama-ai/concrete/blob/main/LICENSE.txt
|
||||
// for license information.
|
||||
|
||||
#ifndef CONCRETELANG_RUNTIME_UTILS_H
|
||||
#define CONCRETELANG_RUNTIME_UTILS_H
|
||||
|
||||
#include "llvm/Support/TargetSelect.h"
|
||||
|
||||
namespace mlir {
|
||||
namespace concretelang {
|
||||
|
||||
// Mainly a wrapper to some LLVM functions. The reason to have this wrapper is
|
||||
// to avoid linking conflicts between the python binary extension, and LLVM.
|
||||
void LLVMInitializeNativeTarget();
|
||||
|
||||
} // namespace concretelang
|
||||
} // namespace mlir
|
||||
|
||||
#endif
|
||||
@@ -3,6 +3,7 @@ add_compile_options(-fsized-deallocation)
|
||||
if(CONCRETELANG_CUDA_SUPPORT)
|
||||
add_library(
|
||||
ConcretelangRuntime SHARED
|
||||
utils.cpp
|
||||
context.cpp
|
||||
simulation.cpp
|
||||
wrappers.cpp
|
||||
@@ -13,6 +14,7 @@ if(CONCRETELANG_CUDA_SUPPORT)
|
||||
else()
|
||||
add_library(
|
||||
ConcretelangRuntime SHARED
|
||||
utils.cpp
|
||||
context.cpp
|
||||
simulation.cpp
|
||||
wrappers.cpp
|
||||
|
||||
15
compilers/concrete-compiler/compiler/lib/Runtime/utils.cpp
Normal file
15
compilers/concrete-compiler/compiler/lib/Runtime/utils.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
// Part of the Concrete Compiler Project, under the BSD3 License with Zama
|
||||
// Exceptions. See
|
||||
// https://github.com/zama-ai/concrete/blob/main/LICENSE.txt
|
||||
// for license information.
|
||||
|
||||
#include "concretelang/Runtime/utils.h"
|
||||
|
||||
namespace mlir {
|
||||
namespace concretelang {
|
||||
void LLVMInitializeNativeTarget() {
|
||||
llvm::InitializeNativeTarget();
|
||||
llvm::InitializeNativeTargetAsmPrinter();
|
||||
}
|
||||
} // namespace concretelang
|
||||
} // namespace mlir
|
||||
@@ -39,6 +39,7 @@ add_mlir_library(
|
||||
MLIRExecutionEngine
|
||||
${LLVM_PTHREAD_LIB}
|
||||
TFHEDialectAnalysis
|
||||
ConcreteDialectAnalysis)
|
||||
ConcreteDialectAnalysis
|
||||
ConcretelangRuntime)
|
||||
|
||||
target_include_directories(ConcretelangSupport PUBLIC ${CONCRETE_CPU_INCLUDE_DIR})
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
#include "concretelang/Dialect/SDFG/Transforms/Passes.h"
|
||||
#include "concretelang/Dialect/TFHE/Analysis/ExtractStatistics.h"
|
||||
#include "concretelang/Dialect/TFHE/Transforms/Transforms.h"
|
||||
#include "concretelang/Runtime/utils.h"
|
||||
#include "concretelang/Support/CompilerEngine.h"
|
||||
#include "concretelang/Support/Error.h"
|
||||
#include "concretelang/Support/Pipeline.h"
|
||||
@@ -630,8 +631,7 @@ std::unique_ptr<llvm::Module>
|
||||
lowerLLVMDialectToLLVMIR(mlir::MLIRContext &context,
|
||||
llvm::LLVMContext &llvmContext,
|
||||
mlir::ModuleOp &module) {
|
||||
llvm::InitializeNativeTarget();
|
||||
llvm::InitializeNativeTargetAsmPrinter();
|
||||
mlir::concretelang::LLVMInitializeNativeTarget();
|
||||
mlir::registerLLVMDialectTranslation(*module->getContext());
|
||||
mlir::registerOpenMPDialectTranslation(*module->getContext());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user