Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions circle-mlir/Makefile.sample
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ PYTHON3_PATH=$(shell dirname $(PYTHON3_CMD))

CIRCLEMLIR_BUILD_DEBUG?=build/debug
CIRCLEMLIR_BUILD_REL?=build/release
CIRCLEMLIR_BUILD_COV?=build/coverage
CIRCLEMLIR_EXTS_DEBUG?=build/externals/debug
CIRCLEMLIR_EXTS_REL?=build/externals/release

Expand All @@ -40,6 +41,12 @@ help:
@echo "make prepr : prepare externals for release (needed only once)"
@echo "make cfgr : configure circle-mlir for release build"
@echo "make rel : build for release"
@echo "make prepcov : prepare submodules for coverage test (needed only once)"
@echo "make cfgcov : configure circle-mlir for debug build with coverage test"
@echo "make debugcov : build for test coverage"
@echo "make testcov : run coverage test"
@echo "make gencov : generate test coverage report"
@echo "make cleancov : clean test coverage build"
@echo "make testr : test for release"
@echo "make cleanr : clean release build"
@echo "make cleanall : clean all build including overlay, externals"
Expand All @@ -52,6 +59,9 @@ all: cfg debug
_mkbuild:
mkdir -p $(CIRCLEMLIR_BUILD_DEBUG)

_mkbuildcov:
mkdir -p $(CIRCLEMLIR_BUILD_COV)

_mkbuildr:
mkdir -p $(CIRCLEMLIR_BUILD_REL)

Expand Down Expand Up @@ -86,6 +96,36 @@ clean:
rm -f $(CIRCLEMLIR_BUILD_DEBUG)/CMakeCache.txt
rm -rf $(CIRCLEMLIR_BUILD_DEBUG)/circle-mlir/

#-------------------------------------------------------------------------------
# for debug test coverage

prepcov: _mkbuildcov
Python3_ROOT_DIR=$(CIRCLEMLIR_PY3_ROOT) \
cmake -B $(CIRCLEMLIR_EXTS_DEBUG) -S ./externals -DCMAKE_BUILD_TYPE=Release
cmake --build $(CIRCLEMLIR_EXTS_DEBUG) -j$(CIRCLEMLIR_BUILD_JOBS)

cfgcov: _mkbuildcov
cmake -B $(CIRCLEMLIR_BUILD_COV) -S ./ \
-DCIRCLE_MLIR_EXTERNALS=$(CIRCLEMLIR_EXTS_DEBUG) \
-DONNX2CIRCLE_TEST_MODELS_SINGLE=ON \
-DENABLE_COVERAGE=ON

debugcov:
CM_PASS_DUMP=2 \
cmake --build $(CIRCLEMLIR_BUILD_COV) -j$(CIRCLEMLIR_BUILD_JOBS)

testcov:
CM_PASS_DUMP=2 \
CTEST_OUTPUT_ON_FAILURE=1 \
cmake --build $(CIRCLEMLIR_BUILD_COV) --verbose -- test

gencov:
bash infra/tools/gen-coverage-report circle-mlir

cleancov:
rm -f $(CIRCLEMLIR_BUILD_COV)/CMakeCache.txt
rm -rf $(CIRCLEMLIR_BUILD_COV)/circle-mlir/

#-------------------------------------------------------------------------------
# for release

Expand Down
22 changes: 22 additions & 0 deletions circle-mlir/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,28 @@ Test build
make testr
```

### Test coverage

To get test coverage report, run as following commands.
- assume you already have done `make overlay` and `make prepcov`
- you can skip `make prepcov` step if you are using local installation with `CIRCLE_MLIR_LOCALINST`
```
make cfgcov

make debugcov
make testcov
make gencov
```

Open `converage/html/index.html` file in web browser to see the reports.

To generate from second run and so on in your local machine, you need to
remove existing files before running `gencov`
```
rm -rf coverage
make gencov
```

## TensorFlow source code

Some source codes are referenced from TensorFlow and the file path is added to
Expand Down