Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
78 lines (72 loc) · 3.32 KB
/
Copy pathMakefile
File metadata and controls
78 lines (72 loc) · 3.32 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
LIBNAME = tileop-api
VERSION = 0.58.7
HEADERS = $(wildcard include/*.h) $(wildcard include/*.hpp) include/jcore include/cpu_sim include/aarch64 include/common
TILEOP_API_REVISION ?= $(shell git rev-parse HEAD 2>/dev/null || printf unknown)
TILEOP_API_REVISION_IS_EXACT ?= $(shell test -z "$$(git status --porcelain --untracked-files=all 2>/dev/null)" && printf 1 || printf 0)
# install to system include directory of Clang
CLANG_PREFIX ?=
INSTALL_DIR = $(shell $(CLANG_PREFIX)/bin/clang -print-resource-dir)/include/$(LIBNAME)
.PHONY: check install uninstall
check:
python3 tools/generate_engine_docs.py --check
python3 tools/check_issue_49_docs.py
python3 tools/check_issue_269_docs.py
python3 tools/check_tileop_usage_examples.py
python3 tools/check_no_legacy_tileop_api.py
python3 tools/check_pto_catalog_alignment.py
python3 test/test_packed_global_stride.py
python3 test/test_mx_local_scale_contract.py
python3 test/test_f32_norm_element_view_api.py
python3 test/test_v058_engine_contract.py
python3 test/test_pto0585_layout_interfaces.py
python3 test/test_issue_272_276_contract.py
python3 test/test_issue_398_399_contract.py
python3 test/test_tpack_element_assembly_api.py
python3 test/test_pr_gate_cache_order.py
python3 test/test_version_header.py
python3 test/test_element_tile_api.py
python3 test/test_i64_element_tile_api.py
python3 test/test_i64_element_tile_runtime.py
python3 test/test_integer_element_storage.py
python3 test/test_dense_f16_element_tile_api.py
python3 test/test_hierarchical_element_storage_api.py
$(CXX) -std=c++20 -D__linx -include test/linx_host_type_shim.hpp \
-fsyntax-only -Iinclude test/ptoas_linx_type_compat.cpp
$(CXX) -std=c++20 -D__linx -include test/linx_host_type_shim.hpp \
-fsyntax-only -Iinclude test/pto0583_contract.cpp
bash -n test/tileop_api/compile.all test/tileop_api/run_negatives.sh \
test/tileop_api/verify_pto0583_asm.sh \
test/tileop_api/verify_target_cxx_frontend.sh
@if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then \
git diff --check; \
fi
install:
@echo "Installing $(LIBNAME) to Clang toolchain at $(INSTALL_DIR)"
@mkdir -p $(INSTALL_DIR)
@cp -r $(HEADERS) $(INSTALL_DIR)
@{ \
echo '#ifndef PTO_TILEOP_API_REVISION_HPP'; \
echo '#define PTO_TILEOP_API_REVISION_HPP'; \
echo ''; \
echo '#define PTO_TILEOP_API_VERSION "$(VERSION)"'; \
echo '#define PTO_TILEOP_API_SPEC_VERSION "0.58.7"'; \
echo '#define PTO_TILEOP_API_REVISION "$(TILEOP_API_REVISION)"'; \
echo '#define PTO_TILEOP_API_REVISION_IS_EXACT $(TILEOP_API_REVISION_IS_EXACT)'; \
echo ''; \
echo '#define PTO_TILEOP_API_HAS_LOCAL_B_KN_FIX 1'; \
echo '#define PTO_TILEOP_API_HAS_TEXPDIF 1'; \
echo '#define PTO_TILEOP_API_HAS_ELEMENT_TILE 1'; \
echo '#define PTO_TILEOP_API_HAS_ELEMENT_VIEW_METADATA 1'; \
echo '#define PTO_TILEOP_API_HAS_TYPED_ELEMENT_VIEWS 1'; \
echo '#define PTO_TILEOP_API_HAS_512_INTEGER_ELEMENT_TILE 1'; \
echo '#define PTO_TILEOP_API_HAS_I64_ELEMENT_TILE_LEAF32 1'; \
echo '#define PTO_TILEOP_API_HAS_DENSE_F16_U16_ELEMENT_TILE 1'; \
echo '#define PTO_TILEOP_API_HAS_HIERARCHICAL_ELEMENT_STORAGE 1'; \
echo ''; \
echo '#endif'; \
} > $(INSTALL_DIR)/common/pto_tileop_api_revision.hpp
@echo "Installation complete. Now you can use #include <$(LIBNAME)/header.h>"
uninstall:
@echo "Removing $(INSTALL_DIR)"
@rm -rf $(INSTALL_DIR)
@echo "Uninstall complete"