forked from TiledTensor/TiledCUDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (28 loc) · 839 Bytes
/
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
EXAMPLE_DIR := examples
TEST_DIR := tests/python
UNIT_TEST ?= test_lstm_cell
CPP_UT ?= test_copy
CPP_UTS := scripts/unittests/run_all_cpp_tests.sh
PY_EXAMPLE ?= $(EXAMPLE_DIR)/python/scatter_nd.py
CPP_EXAMPLE ?= $(EXAMPLE_DIR)/cpp/b2b_gemm/b2b_gemm
UNIT ?= $(TEST_DIR)/$(UNIT_TEST).py
WITH_TEST ?= ON
BUILD_DIR := build
DYNAMIC_LIB := $(BUILD_DIR)/libtiledcuda.so
.PHONY: build example unit_test clean
build:
@mkdir -p build
@cd build && cmake -DWITH_TESTING=$(WITH_TEST) .. && make -j$(proc)
$(DYNAMIC_LIB): build
py_example: $(DYNAMIC_LIB)
@python3 $(PY_EXAMPLE)
cpp_example: $(DYNAMIC_LIB)
@./$(BUILD_DIR)/$(CPP_EXAMPLE)
unit_test: $(DYNAMIC_LIB)
@python3 $(UNIT)
unit_test_cpp: $(DYNAMIC_LIB)
@cd $(BUILD_DIR) && ctest -R $(CPP_UT) -V
unit_test_cpps: $(DYNAMIC_LIB)
@sh $(CPP_UTS)
clean:
@rm -rf build