Skip to content

Commit

Permalink
DRAFT initial circle-mlir project
Browse files Browse the repository at this point in the history
on-going draft to introduce initial circle-mlir project.

Signed-off-by: SaeHie Park <[email protected]>
  • Loading branch information
seanshpark committed Feb 11, 2025
1 parent 9cedc06 commit be58ac2
Show file tree
Hide file tree
Showing 48 changed files with 4,365 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/run-circle-mlir-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ jobs:
-DCMAKE_BUILD_TYPE=${{ matrix.type }} \
-DCIRCLE_MLIR_WORKDIR=/workdir
- name: Build
- name: Build, test & install
run: |
cd circle-mlir
cmake --build build/${{ matrix.type }} -j4
CTEST_OUTPUT_ON_FAILURE=1 cmake --build build/${{ matrix.type }} --verbose -- test
cmake --build build/${{ matrix.type }} -j4 -- install
2 changes: 2 additions & 0 deletions circle-mlir/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Makefile
build
28 changes: 28 additions & 0 deletions circle-mlir/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,35 @@ endif()
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_compile_options("-fexceptions")

list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/infra/cmake")

# Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24:
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0135 NEW)
endif()

# configuration flags
include(CfgOptionFlags)

# enable test coverage
include(TestCoverage)

# enable ctest
include(CTest)

# enable googletest
include(GTestHelper)
include(GoogleTest)

# to override submodules install
if(DEFINED ENV{CIRCLE_MLIR_LOCALINST})
set(CIRCLE_MLIR_LOCALINST $ENV{CIRCLE_MLIR_LOCALINST})
endif()

if(CIRCLE_MLIR_LOCALINST)
message(STATUS "CIRCLE_MLIR_LOCALINST=${CIRCLE_MLIR_LOCALINST}")
endif()

set(RES_CIRCLE_SCHEMA "${CMAKE_SOURCE_DIR}/../res/CircleSchema")

add_subdirectory(circle-mlir)
6 changes: 6 additions & 0 deletions circle-mlir/circle-mlir/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include(UseMLIR)
include(UseAbseil)

add_subdirectory(lib)
add_subdirectory(tools)
add_subdirectory(tools-test)
9 changes: 9 additions & 0 deletions circle-mlir/circle-mlir/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
add_subdirectory(tools)

add_subdirectory(arser)
add_subdirectory(schema)
add_subdirectory(dialect)
#add_subdirectory(utils)
#add_subdirectory(pass)
#add_subdirectory(import)
#add_subdirectory(export)
19 changes: 19 additions & 0 deletions circle-mlir/circle-mlir/lib/arser/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
add_library(arser INTERFACE)

# It specifies INTERFACE so that future targets linked with arser library will inherit its include directory.
# It means that a developer who want to link arser just need to add one line.
# target_link_library(another-users-target arser)
target_include_directories(arser INTERFACE include/)

# NOTE test for arser are removed.
# instead, add arser_validate to validate header compilation.
add_library(arser_validate STATIC src/arser.cpp)
target_link_libraries(arser_validate PUBLIC arser)

if(NOT ENABLE_TEST)
return()
endif()

GTest_AddTest(arser_test test/arser.test.cpp)
target_link_libraries(arser_test arser)
target_link_libraries(arser_test cirmlir_coverage)
3 changes: 3 additions & 0 deletions circle-mlir/circle-mlir/lib/arser/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# arser

From https://github.com/Samsung/ONE/tree/d808a9973093bf8062a253d5c8f66072d7100551/compiler/arser
Loading

0 comments on commit be58ac2

Please sign in to comment.