Skip to content

Commit be58ac2

Browse files
committed
DRAFT initial circle-mlir project
on-going draft to introduce initial circle-mlir project. Signed-off-by: SaeHie Park <[email protected]>
1 parent 9cedc06 commit be58ac2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+4365
-1
lines changed

.github/workflows/run-circle-mlir-build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ jobs:
6060
-DCMAKE_BUILD_TYPE=${{ matrix.type }} \
6161
-DCIRCLE_MLIR_WORKDIR=/workdir
6262
63-
- name: Build
63+
- name: Build, test & install
6464
run: |
6565
cd circle-mlir
6666
cmake --build build/${{ matrix.type }} -j4
67+
CTEST_OUTPUT_ON_FAILURE=1 cmake --build build/${{ matrix.type }} --verbose -- test
68+
cmake --build build/${{ matrix.type }} -j4 -- install

circle-mlir/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Makefile
2+
build

circle-mlir/CMakeLists.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,35 @@ endif()
1313
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
1414
add_compile_options("-fexceptions")
1515

16+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/infra/cmake")
17+
1618
# Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24:
1719
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
1820
cmake_policy(SET CMP0135 NEW)
1921
endif()
22+
23+
# configuration flags
24+
include(CfgOptionFlags)
25+
26+
# enable test coverage
27+
include(TestCoverage)
28+
29+
# enable ctest
30+
include(CTest)
31+
32+
# enable googletest
33+
include(GTestHelper)
34+
include(GoogleTest)
35+
36+
# to override submodules install
37+
if(DEFINED ENV{CIRCLE_MLIR_LOCALINST})
38+
set(CIRCLE_MLIR_LOCALINST $ENV{CIRCLE_MLIR_LOCALINST})
39+
endif()
40+
41+
if(CIRCLE_MLIR_LOCALINST)
42+
message(STATUS "CIRCLE_MLIR_LOCALINST=${CIRCLE_MLIR_LOCALINST}")
43+
endif()
44+
45+
set(RES_CIRCLE_SCHEMA "${CMAKE_SOURCE_DIR}/../res/CircleSchema")
46+
47+
add_subdirectory(circle-mlir)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
include(UseMLIR)
2+
include(UseAbseil)
3+
4+
add_subdirectory(lib)
5+
add_subdirectory(tools)
6+
add_subdirectory(tools-test)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
add_subdirectory(tools)
2+
3+
add_subdirectory(arser)
4+
add_subdirectory(schema)
5+
add_subdirectory(dialect)
6+
#add_subdirectory(utils)
7+
#add_subdirectory(pass)
8+
#add_subdirectory(import)
9+
#add_subdirectory(export)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
add_library(arser INTERFACE)
2+
3+
# It specifies INTERFACE so that future targets linked with arser library will inherit its include directory.
4+
# It means that a developer who want to link arser just need to add one line.
5+
# target_link_library(another-users-target arser)
6+
target_include_directories(arser INTERFACE include/)
7+
8+
# NOTE test for arser are removed.
9+
# instead, add arser_validate to validate header compilation.
10+
add_library(arser_validate STATIC src/arser.cpp)
11+
target_link_libraries(arser_validate PUBLIC arser)
12+
13+
if(NOT ENABLE_TEST)
14+
return()
15+
endif()
16+
17+
GTest_AddTest(arser_test test/arser.test.cpp)
18+
target_link_libraries(arser_test arser)
19+
target_link_libraries(arser_test cirmlir_coverage)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# arser
2+
3+
From https://github.com/Samsung/ONE/tree/d808a9973093bf8062a253d5c8f66072d7100551/compiler/arser

0 commit comments

Comments
 (0)