-
Notifications
You must be signed in to change notification settings - Fork 151
/
Makefile
55 lines (38 loc) · 1.42 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# -*- coding: utf-8 -*-
# (C) Copyright 2020, 2021, 2022, 2023 IBM. All Rights Reserved.
#
# Licensed under the MIT license. See LICENSE file in the project root for details.
.PHONY: build_inplace clean clean-doc clang-format mypy pycodestyle pylint pytest build_inplace_mkl build_inplace_cuda build_cuda
build_inplace:
python setup.py build_ext -j8 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE --inplace ${flags}
build_inplace_mkl:
make build_inplace flags="-DRPU_BLAS=MKL -DINTEL_MKL_DIR=${MKLROOT} ${flags}"
build:
python setup.py install --user -j8 -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE ${flags}
build_mkl:
make build flags="-DRPU_BLAS=MKL -DINTEL_MKL_DIR=${MKLROOT} ${flags}"
build_cuda:
make build_mkl flags="-DUSE_CUDA=ON ${flags}"
build_inplace_cuda:
make build_inplace_mkl flags="-DUSE_CUDA=ON ${flags}"
clean:
python setup.py clean
rm -rf _skbuild
rm -f src/aihwkit/simulator/rpu_base*.so
rm -f src/aihwkit/extension/*.so
clean-doc:
cd docs && make clean
clang-format:
git ls-files | grep -E ".*\.(cu|h|cpp)$$" | xargs clang-format -i
doc:
cd docs && make html
mypy:
mypy --show-error-codes src/
pycodestyle:
pycodestyle src/ tests/ examples/
pylint:
PYTHONPATH=src/ git ls-files | grep -E ".*\.py$$" | grep -v "pb2\.py$$" | xargs pylint -rn
pytest:
PYTHONPATH=src/ pytest -v -s tests/
black:
git ls-files | grep \.py$$ | xargs black -t py310 -C --config .black