Skip to content

Commit

Permalink
fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
effrey-liu committed Oct 30, 2024
2 parents 7adb1fd + 2b2a8df commit a0685b2
Show file tree
Hide file tree
Showing 194 changed files with 14,018 additions and 762 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@

# Clangd cache
.cache

# Clangd configurations
.clangd
43 changes: 25 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR BUDDY_MLIR_OUT_OF_TREE_
message(STATUS "Using MLIRConfig.cmake in: ${MLIR_DIR}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")

set(LLVM_MLIR_BINARY_DIR ${MLIR_DIR}/../../../bin)
set(LLVM_MLIR_LIBRARY_DIR ${MLIR_DIR}/../../../lib)
set(LLVM_PROJECT_BUILD_DIR ${MLIR_DIR}/../../../)
if(NOT DEFINED LLVM_PROJECT_SOURCE_DIR)
get_filename_component(LLVM_PROJECT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/llvm/ ABSOLUTE)
# LLVM_MAIN_SRC_DIR is a private variable for the LLVM in-tree build.
# To provide compatibility for unifying the one-step and two-step build,
# we set LLVM_MAIN_SRC_DIR ourselves here.
# This could benefit users who want to specify a custom LLVM source directory,
# but also not interfere with normal users who just want to use the buddy-mlir provided LLVM sources.
if(NOT DEFINED LLVM_MAIN_SRC_DIR)
get_filename_component(LLVM_MAIN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/llvm/llvm ABSOLUTE)
endif()
set(LLVM_MLIR_SOURCE_DIR ${LLVM_PROJECT_SOURCE_DIR}/mlir)
set(MLIR_MAIN_SRC_DIR ${LLVM_MAIN_SRC_DIR}/../mlir)

list(APPEND CMAKE_MODULE_PATH "${MLIR_CMAKE_DIR}")
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
Expand All @@ -66,16 +68,9 @@ else()
#-------------------------------------------------------------------------------
# MLIR/LLVM Configuration
#-------------------------------------------------------------------------------

# Allow using out-of-tree llvm directory
set(LLVM_PROJECT_SOURCE_DIR ${LLVM_MAIN_SRC_DIR}/..)
message(STATUS "Using LLVM Project ${LLVM_PROJECT_SOURCE_DIR}")

set(MLIR_MAIN_SRC_DIR ${LLVM_MAIN_SRC_DIR}/../mlir)
set(MLIR_INCLUDE_DIR ${MLIR_MAIN_SRC_DIR}/include)
set(MLIR_GENERATED_INCLUDE_DIR ${LLVM_BINARY_DIR}/tools/mlir/include)
set(LLVM_MLIR_BINARY_DIR ${CMAKE_BINARY_DIR}/bin)
set(MLIR_INCLUDE_DIRS "${MLIR_INCLUDE_DIR};${MLIR_GENERATED_INCLUDE_DIR}")
endif()

#-------------------------------------------------------------------------------
Expand All @@ -98,12 +93,22 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${BUDDY_LIBRARY_DIR})
set(BUDDY_EXAMPLES OFF CACHE BOOL "Build examples")
set(BUDDY_ENABLE_OPENCV OFF CACHE BOOL "Enable OpenCV support.")

if(BUDDY_ENABLE_OPENCV)
add_definitions(-DBUDDY_ENABLE_OPENCV)
find_package(JPEG REQUIRED)
if(BUDDY_ENABLE_OPENCV)
add_definitions(-DBUDDY_ENABLE_OPENCV)
find_package(JPEG REQUIRED)
find_package(PNG REQUIRED)
find_package(OpenCV REQUIRED CONFIG)
include_directories(${OpenCV_INCLUDE_DIRS})
endif()

if(BUDDY_MLIR_ENABLE_DIP_LIB)
add_definitions(-DBUDDY_MLIR_ENABLE_DIP_LIB)
find_package(PNG REQUIRED)
endif()

if(BUDDY_ENABLE_PNG)
add_definitions(-DBUDDY_ENABLE_PNG)
find_package(PNG REQUIRED)
find_package(OpenCV REQUIRED CONFIG)
include_directories(${OpenCV_INCLUDE_DIRS})
endif()

# Generate libraries into `lib` of build directory.
Expand Down Expand Up @@ -220,6 +225,8 @@ if(BUDDY_MLIR_ENABLE_PYTHON_PACKAGES)
# Create empty __init__.py files to make these directories Python packages
file(WRITE ${BUDDY_MLIR_PYTHON_PACKAGES_DIR}/buddy/__init__.py "")
file(WRITE ${BUDDY_MLIR_PYTHON_PACKAGES_DIR}/buddy/compiler/__init__.py "")

install(DIRECTORY ${BUDDY_MLIR_PYTHON_PACKAGES_DIR}/buddy DESTINATION python_packages)
endif()

#-------------------------------------------------------------------------------
Expand Down
34 changes: 29 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,37 @@ $ cmake -G Ninja .. \
-DCMAKE_BUILD_TYPE=RELEASE \
-DBUDDY_MLIR_ENABLE_PYTHON_PACKAGES=ON \
-DPython3_EXECUTABLE=$(which python3)
$ ninja
$ ninja check-buddy
$ export BUDDY_MLIR_BUILD_DIR=$PWD
$ export LLVM_MLIR_BUILD_DIR=$PWD/../llvm/build
$ export PYTHONPATH=${LLVM_MLIR_BUILD_DIR}/tools/mlir/python_packages/mlir_core:${BUDDY_MLIR_BUILD_DIR}/python_packages:${PYTHONPATH}
```

To configure the build environment for using image processing libraries, follow these steps:

```
$ cmake -G Ninja .. \
-DMLIR_DIR=$PWD/../llvm/build/lib/cmake/mlir \
-DLLVM_DIR=$PWD/../llvm/build/lib/cmake/llvm \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DCMAKE_BUILD_TYPE=RELEASE \
-DBUDDY_MLIR_ENABLE_DIP_LIB=ON \
-DBUDDY_ENABLE_PNG=ON
$ ninja
$ ninja check-buddy
```

If you want to add domain-specific framework support, please add the following cmake options:
To build buddy-mlir with custom LLVM sources:

| Framework | Enable Option | Other Options |
| -------------- | ------------- | ------------- |
| OpenCV | `-DBUDDY_ENABLE_OPENCV=ON` | Add `-DOpenCV_DIR=</PATH/TO/OPENCV/BUILD/>` or install OpenCV release version on your local device. |
```
$ cmake -G Ninja .. \
-DMLIR_DIR=PATH/TO/LLVM/lib/cmake/mlir \
-DLLVM_DIR=PATH/TO/LLVM/lib/cmake/llvm \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DCMAKE_BUILD_TYPE=RELEASE \
-DLLVM_MAIN_SRC_DIR=PATH/TO/LLVM_SOURCE
```

<h3 id="one-step">One-step building strategy</h3>

Expand Down Expand Up @@ -134,7 +158,7 @@ This repository have nix flake support. You can follow the [nix installation ins
nix develop .
```

This will setup a bash shell with `clang`, `clangd`, `cmake`, `ninja`, and other necessary dependencies to build buddy-mlir from source.
This will setup a bash shell with `clang`, `ccls`, `cmake`, `ninja`, and other necessary dependencies to build buddy-mlir from source.

- If you want to use the buddy-mlir bintools

Expand Down
2 changes: 1 addition & 1 deletion backend/include/llvm/IR/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include_directories(${LLVM_PROJECT_SOURCE_DIR}/llvm/include/llvm/IR/)
include_directories(${LLVM_MAIN_SRC_DIR}/include/llvm/IR/)

set(LLVM_TARGET_DEFINITIONS IntrinsicsBuddyExt.td)
tablegen(LLVM IntrinsicImpl.inc -gen-intrinsic-impl)
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/Analysis/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_Analysis_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/Analysis)
set(LLVM_Analysis_DIR ${LLVM_MAIN_SRC_DIR}/lib/Analysis)

add_llvm_component_library(LLVMBuddyAnalysis

Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/AsmParser/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AsmParser

set(LLVM_AsmParser_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/AsmParser)
set(LLVM_AsmParser_DIR ${LLVM_MAIN_SRC_DIR}/lib/AsmParser)

add_llvm_component_library(LLVMBuddyAsmParser
${LLVM_AsmParser_DIR}/LLLexer.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/Bitcode/Reader/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_Reader_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/Bitcode/Reader)
set(LLVM_Reader_DIR ${LLVM_MAIN_SRC_DIR}/lib/Bitcode/Reader)

add_llvm_component_library(LLVMBuddyBitReader
${LLVM_Reader_DIR}/BitcodeAnalyzer.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/Bitcode/Writer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_Writer_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/Bitcode/Writer)
set(LLVM_Writer_DIR ${LLVM_MAIN_SRC_DIR}/lib/Bitcode/Writer)


add_llvm_component_library(LLVMBuddyBitWriter
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/CodeGen/AsmPrinter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_AsmPrinter_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/CodeGen/AsmPrinter)
set(LLVM_AsmPrinter_DIR ${LLVM_MAIN_SRC_DIR}/lib/CodeGen/AsmPrinter)

add_llvm_component_library(LLVMBuddyAsmPrinter
${LLVM_AsmPrinter_DIR}/AccelTable.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/CodeGen/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_CodeGen_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/CodeGen)
set(LLVM_CodeGen_DIR ${LLVM_MAIN_SRC_DIR}/lib/CodeGen)

add_llvm_component_library(LLVMBuddyCodeGen
${LLVM_CodeGen_DIR}/AggressiveAntiDepBreaker.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/CodeGen/MIRParser/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_MIRParser_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/CodeGen/MIRParser)
set(LLVM_MIRParser_DIR ${LLVM_MAIN_SRC_DIR}/lib/CodeGen/MIRParser)

add_llvm_component_library(LLVMBuddyMIRParser
${LLVM_MIRParser_DIR}/MILexer.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_SelectionDAG_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/CodeGen/SelectionDAG)
set(LLVM_SelectionDAG_DIR ${LLVM_MAIN_SRC_DIR}/lib/CodeGen/SelectionDAG)

add_llvm_component_library(LLVMBuddySelectionDAG
${LLVM_SelectionDAG_DIR}/DAGCombiner.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/IR/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_IR_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/IR)
set(LLVM_IR_DIR ${LLVM_MAIN_SRC_DIR}/lib/IR)

add_llvm_component_library(LLVMBuddyCore
${LLVM_IR_DIR}/AbstractCallSite.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/IRReader/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_IRReader_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/IRReader)
set(LLVM_IRReader_DIR ${LLVM_MAIN_SRC_DIR}/lib/IRReader)

add_llvm_component_library(LLVMBuddyIRReader
${LLVM_IRReader_DIR}/IRReader.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/Object/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_Object_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/Object)
set(LLVM_Object_DIR ${LLVM_MAIN_SRC_DIR}/lib/Object)

add_llvm_component_library(LLVMBuddyObject
${LLVM_Object_DIR}/Archive.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/ProfileData/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_ProfileData_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/ProfileData)
set(LLVM_ProfileData_DIR ${LLVM_MAIN_SRC_DIR}/lib/ProfileData)

add_llvm_component_library(LLVMBuddyProfileData
${LLVM_ProfileData_DIR}/GCOV.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/Remarks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_Remarks_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/Remarks)
set(LLVM_Remarks_DIR ${LLVM_MAIN_SRC_DIR}/lib/Remarks)

add_llvm_component_library(LLVMBuddyRemarks
${LLVM_Remarks_DIR}/BitstreamRemarkParser.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/Target/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ list(APPEND LLVM_COMMON_DEPENDS buddy_intrinsics_gen)

list(APPEND LLVM_TABLEGEN_FLAGS -I ${LLVM_MAIN_SRC_DIR}/lib/Target)

set(LLVM_Target_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/Target)
set(LLVM_Target_DIR ${LLVM_MAIN_SRC_DIR}/lib/Target)

add_llvm_component_library(LLVMBuddyTarget
${LLVM_Target_DIR}/Target.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/Target/RISCV/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ macro(buddy_add_llvm_target target_name)
set( CURRENT_LLVM_TARGET LLVM${target_name} )
endmacro(buddy_add_llvm_target)

set(LLVM_TARGET_RISCV_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/Target/RISCV)
set(LLVM_TARGET_RISCV_DIR ${LLVM_MAIN_SRC_DIR}/lib/Target/RISCV)

# ------------------------------------------------------------------------------
# Configure RISC-V Buddy Extension.
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/Transforms/IPO/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_IPO_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/Transforms/IPO)
set(LLVM_IPO_DIR ${LLVM_MAIN_SRC_DIR}/lib/Transforms/IPO)

add_llvm_component_library(LLVMBuddyIPO
${LLVM_IPO_DIR}/AlwaysInliner.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/Transforms/Scalar/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_Scalar_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/Transforms/Scalar)
set(LLVM_Scalar_DIR ${LLVM_MAIN_SRC_DIR}/lib/Transforms/Scalar)

add_llvm_component_library(LLVMBuddyScalarOpts
${LLVM_Scalar_DIR}/ADCE.cpp
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/Transforms/Utils/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_Utils_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/Transforms/Utils)
set(LLVM_Utils_DIR ${LLVM_MAIN_SRC_DIR}/lib/Transforms/Utils)


add_llvm_component_library(LLVMBuddyTransformUtils
Expand Down
2 changes: 1 addition & 1 deletion backend/llvm/lib/Transforms/Vectorize/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_Vectorize_DIR ${LLVM_PROJECT_SOURCE_DIR}/llvm/lib/Transforms/Vectorize)
set(LLVM_Vectorize_DIR ${LLVM_MAIN_SRC_DIR}/lib/Transforms/Vectorize)

add_llvm_component_library(LLVMBuddyVectorize
${LLVM_Vectorize_DIR}/LoadStoreVectorizer.cpp
Expand Down
10 changes: 10 additions & 0 deletions docs/PythonEnvironment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Python Virtual Environment Setup Guide for Buddy-mlir

We recommend you to use anaconda3 to create python virtual environment. You should install python packages as buddy-mlir/requirements.

```bash
$ conda create -n <your virtual environment name> python=3.11
$ conda activate <your virtual environment name>
$ cd buddy-mlir
$ pip install -r requirements.txt
```
File renamed without changes.
20 changes: 10 additions & 10 deletions examples/BuddyBert/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ add_custom_command(

add_custom_command(
OUTPUT forward.o
COMMAND ${LLVM_MLIR_BINARY_DIR}/mlir-opt ${BUDDY_EXAMPLES_DIR}/BuddyBert/forward.mlir
COMMAND ${LLVM_TOOLS_BINARY_DIR}/mlir-opt ${BUDDY_EXAMPLES_DIR}/BuddyBert/forward.mlir
-pass-pipeline "builtin.module(func.func(tosa-to-linalg-named, tosa-to-linalg, tosa-to-tensor, tosa-to-arith), empty-tensor-to-alloc-tensor, convert-elementwise-to-linalg, arith-bufferize, func.func(linalg-bufferize, tensor-bufferize), func-bufferize)" |
${LLVM_MLIR_BINARY_DIR}/mlir-opt
${LLVM_TOOLS_BINARY_DIR}/mlir-opt
-pass-pipeline "builtin.module(func.func(buffer-deallocation-simplification, convert-linalg-to-loops), eliminate-empty-tensors, func.func(llvm-request-c-wrappers),convert-math-to-llvm, convert-math-to-libm, convert-scf-to-cf, convert-arith-to-llvm, expand-strided-metadata, finalize-memref-to-llvm, convert-func-to-llvm, reconcile-unrealized-casts)" |
${LLVM_MLIR_BINARY_DIR}/mlir-translate -mlir-to-llvmir |
${LLVM_MLIR_BINARY_DIR}/llvm-as |
${LLVM_MLIR_BINARY_DIR}/llc -filetype=obj -relocation-model=pic -O0 -o ${BUDDY_BINARY_DIR}/../examples/BuddyBert/forward.o
${LLVM_TOOLS_BINARY_DIR}/mlir-translate -mlir-to-llvmir |
${LLVM_TOOLS_BINARY_DIR}/llvm-as |
${LLVM_TOOLS_BINARY_DIR}/llc -filetype=obj -relocation-model=pic -O0 -o ${BUDDY_BINARY_DIR}/../examples/BuddyBert/forward.o
DEPENDS ${BUDDY_EXAMPLES_DIR}/BuddyBert/forward.mlir
COMMENT "Building forward.o"
VERBATIM)
Expand All @@ -22,11 +22,11 @@ add_custom_command(
OUTPUT subgraph0.o
COMMAND ${BUDDY_BINARY_DIR}/buddy-opt ${BUDDY_EXAMPLES_DIR}/BuddyBert/subgraph0.mlir
-pass-pipeline "builtin.module(func.func(tosa-to-linalg-named, tosa-to-linalg, tosa-to-tensor, tosa-to-arith), empty-tensor-to-alloc-tensor, convert-elementwise-to-linalg, func-bufferize-dynamic-offset, arith-bufferize, func.func(linalg-bufferize, tensor-bufferize))" |
${LLVM_MLIR_BINARY_DIR}/mlir-opt
${LLVM_TOOLS_BINARY_DIR}/mlir-opt
-pass-pipeline "builtin.module(func.func(buffer-deallocation-simplification, convert-linalg-to-loops), eliminate-empty-tensors, func.func(llvm-request-c-wrappers),convert-math-to-llvm, convert-math-to-libm, convert-scf-to-cf, convert-arith-to-llvm, expand-strided-metadata, finalize-memref-to-llvm, convert-func-to-llvm, reconcile-unrealized-casts)" |
${LLVM_MLIR_BINARY_DIR}/mlir-translate -mlir-to-llvmir |
${LLVM_MLIR_BINARY_DIR}/llvm-as |
${LLVM_MLIR_BINARY_DIR}/llc -filetype=obj -relocation-model=pic -O0 -o ${BUDDY_BINARY_DIR}/../examples/BuddyBert/subgraph0.o
${LLVM_TOOLS_BINARY_DIR}/mlir-translate -mlir-to-llvmir |
${LLVM_TOOLS_BINARY_DIR}/llvm-as |
${LLVM_TOOLS_BINARY_DIR}/llc -filetype=obj -relocation-model=pic -O0 -o ${BUDDY_BINARY_DIR}/../examples/BuddyBert/subgraph0.o
DEPENDS ${BUDDY_EXAMPLES_DIR}/BuddyBert/subgraph0.mlir
COMMENT "Building subgraph0.o"
VERBATIM)
Expand All @@ -36,7 +36,7 @@ add_library(BERT STATIC forward.o subgraph0.o)
SET_TARGET_PROPERTIES(BERT PROPERTIES LINKER_LANGUAGE C)

add_executable(buddy-bert-run bert-main.cpp)
target_link_directories(buddy-bert-run PRIVATE ${LLVM_MLIR_LIBRARY_DIR})
target_link_directories(buddy-bert-run PRIVATE ${LLVM_LIBRARY_DIR})

set(BUDDY_BERT_LIBS BERT mlir_c_runner_utils)
target_link_libraries(buddy-bert-run ${BUDDY_BERT_LIBS})
1 change: 1 addition & 0 deletions examples/BuddyConvolution/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
log.mlir
log.ll
log.s
a.out
Loading

0 comments on commit a0685b2

Please sign in to comment.