Skip to content

Commit 0979e9a

Browse files
committed
[DOCS] Initial docs (#4)
* [DOCS] Initial docs * update instruction
1 parent 8ebca36 commit 0979e9a

File tree

20 files changed

+1207
-3
lines changed

20 files changed

+1207
-3
lines changed

vta/CONTRIBUTORS.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Contributing to VTA
2+
===================
3+
VTA is part of TVM software/hardware stack.
4+
We adopts Apache style committer model.
5+
The package is developed and used by the community.
6+
7+
We actively seek committers that come from community contributors who:
8+
- Made substantial contributions to the project.
9+
- All forms of contributions are valued (see detail in next section).
10+
- Willing to spend time on maintaining and lead the project.
11+
12+
Contributions
13+
-------------
14+
We value all forms of contributions, here is a non-comprehensive
15+
list of contributions that are welcomed
16+
17+
- Documentation and usage examples
18+
- Hardware implementations of the design.
19+
- Community participation, answering questions and issues.
20+
- Code readability and developer guide
21+
- We welcome contributions that add code comments
22+
to improve readability
23+
- We also welcome contributions to docs to explain the
24+
design choices of the internal.
25+
- Test cases to make the codebase more robust
26+
- Tutorials, blog posts, talks that promote the project.
27+
28+
29+
How to Contribute
30+
-----------------
31+
See [Contributor guide](docs/how_to/contribute.md) on how to contribute.
32+
33+
Committers
34+
----------
35+
Committers are people who have made substantial contribution to the project and granted write access to the project.
36+
37+
- [Thierry Moreau](http://homes.cs.washington.edu/~moreau/), University of Washington
38+
- [Tianqi Chen](https://github.com/tqchen), University of Washington

vta/Makefile

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
ROOTDIR = $(CURDIR)
2+
3+
ifndef config
4+
ifneq ("$(wildcard ./config.mk)", "")
5+
config = config.mk
6+
else
7+
config = make/config.mk
8+
endif
9+
endif
10+
include $(config)
11+
12+
export LDFLAGS = -pthread -lm
13+
export CFLAGS = -std=c++11 -Wall -O2 -Iinclude -fPIC
14+
15+
ifdef NNVM_PATH
16+
CFLAGS += -I$(NNVM_PATH)/include
17+
else
18+
NNVM_PATH = $(ROOTDIR)/nnvm
19+
CFLAGS += -I$(NNVM_PATH)/include
20+
endif
21+
22+
ifdef TVM_PATH
23+
CFLAGS += -I$(TVM_PATH)/include -I$(TVM_PATH)/dlpack/include -I$(TVM_PATH)/HalideIR/src
24+
else
25+
TVM_PATH = $(NNVM_PATH)/tvm
26+
CFLAGS += -I$(TVM_PATH)/include -I$(TVM_PATH)/dlpack/include -I$(TVM_PATH)/HalideIR/src
27+
endif
28+
29+
ifdef DMLC_CORE_PATH
30+
CFLAGS += -I$(DMLC_CORE_PATH)/include
31+
else
32+
CFLAGS += -I$(NNVM_PATH)/dmlc-core/include
33+
endif
34+
35+
ifneq ($(ADD_CFLAGS), NONE)
36+
CFLAGS += $(ADD_CFLAGS)
37+
endif
38+
39+
ifneq ($(ADD_LDFLAGS), NONE)
40+
LDFLAGS += $(ADD_LDFLAGS)
41+
endif
42+
43+
ifeq ($(UNAME_S), Darwin)
44+
SHARED_LIBRARY_SUFFIX := dylib
45+
WHOLE_ARCH= -all_load
46+
NO_WHOLE_ARCH= -noall_load
47+
LDFLAGS += -undefined dynamic_lookup
48+
else
49+
SHARED_LIBRARY_SUFFIX := so
50+
WHOLE_ARCH= --whole-archive
51+
NO_WHOLE_ARCH= --no-whole-archive
52+
endif
53+
54+
55+
all: lib/libvta.$(SHARED_LIBRARY_SUFFIX)
56+
57+
SRC = $(wildcard src/*.cc src/*.cc)
58+
ALL_OBJ = $(patsubst %.cc, build/%.o, $(SRC))
59+
ALL_DEP = $(ALL_OBJ)
60+
61+
test: $(TEST)
62+
63+
build/src/%.o: src/%.cc
64+
@mkdir -p $(@D)
65+
$(CXX) $(CFLAGS) -MM -MT build/src/$*.o $< >build/src/$*.d
66+
$(CXX) -c $(CFLAGS) -c $< -o $@
67+
68+
lib/libvta.$(SHARED_LIBRARY_SUFFIX): $(ALL_DEP)
69+
@mkdir -p $(@D)
70+
$(CXX) $(CFLAGS) -shared -o $@ $(filter %.o, $^) $(LDFLAGS)
71+
72+
lint: pylint cpplint
73+
74+
cpplint:
75+
python nnvm/dmlc-core/scripts/lint.py vta cpp include src
76+
77+
pylint:
78+
pylint python/vta --rcfile=$(ROOTDIR)/tests/lint/pylintrc
79+
80+
doc:
81+
doxygen docs/Doxyfile
82+
83+
clean:
84+
$(RM) -rf build lib bin *~ */*~ */*/*~ */*/*/*~ */*.o */*/*.o */*/*/*.o
85+
86+
87+
-include build/*.d
88+
-include build/*/*.d
89+
-include build/*/*/*.d

vta/NEWS.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
TVM Change Log
2+
==============
3+
4+
This file records the changes in VTA stack in reverse chronological order.
5+
6+
7+
## Initial version
8+
9+
- Vivado based hardware
10+
- Driver for PYNQ
11+
- Runtime library.
12+
- TVM compiler stack.

vta/docs/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
doxygen
2+
modules
3+
tutorials
4+
_build

vta/docs/Doxyfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ PROJECT_LOGO =
5858
# entered, it will be relative to the location where doxygen was started. If
5959
# left blank the current directory will be used.
6060

61-
OUTPUT_DIRECTORY = doxygen
61+
OUTPUT_DIRECTORY = docs/doxygen
6262

6363
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
6464
# directories (in 2 levels) under the output directory of each output format and
@@ -771,7 +771,7 @@ WARN_LOGFILE =
771771
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
772772
# Note: If this tag is empty the current directory is searched.
773773

774-
INPUT = ../include
774+
INPUT = include
775775

776776
# This tag can be used to specify the character encoding of the source files
777777
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@@ -796,7 +796,7 @@ INPUT_ENCODING = UTF-8
796796
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl,
797797
# *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js.
798798

799-
FILE_PATTERNS = *.h
799+
FILE_PATTERNS = *.h
800800

801801
# The RECURSIVE tag can be used to specify whether or not subdirectories should
802802
# be searched for input files as well.

vta/docs/Makefile

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
# Makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
PAPER =
8+
BUILDDIR = _build
9+
10+
# User-friendly check for sphinx-build
11+
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
12+
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
13+
endif
14+
15+
# Internal variables.
16+
PAPEROPT_a4 = -D latex_paper_size=a4
17+
PAPEROPT_letter = -D latex_paper_size=letter
18+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
19+
# the i18n builder cannot share the environment and doctrees with the others
20+
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
21+
22+
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext
23+
24+
help:
25+
@echo "Please use \`make <target>' where <target> is one of"
26+
@echo " html to make standalone HTML files"
27+
@echo " dirhtml to make HTML files named index.html in directories"
28+
@echo " singlehtml to make a single large HTML file"
29+
@echo " pickle to make pickle files"
30+
@echo " json to make JSON files"
31+
@echo " htmlhelp to make HTML files and a HTML help project"
32+
@echo " qthelp to make HTML files and a qthelp project"
33+
@echo " applehelp to make an Apple Help Book"
34+
@echo " devhelp to make HTML files and a Devhelp project"
35+
@echo " epub to make an epub"
36+
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
37+
@echo " latexpdf to make LaTeX files and run them through pdflatex"
38+
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
39+
@echo " text to make text files"
40+
@echo " man to make manual pages"
41+
@echo " texinfo to make Texinfo files"
42+
@echo " info to make Texinfo files and run them through makeinfo"
43+
@echo " gettext to make PO message catalogs"
44+
@echo " changes to make an overview of all changed/added/deprecated items"
45+
@echo " xml to make Docutils-native XML files"
46+
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
47+
@echo " linkcheck to check all external links for integrity"
48+
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
49+
@echo " coverage to run coverage check of the documentation (if enabled)"
50+
51+
clean:
52+
rm -rf $(BUILDDIR)/*
53+
rm -rf gen_modules
54+
55+
html:
56+
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
57+
@echo
58+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
59+
60+
dirhtml:
61+
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
62+
@echo
63+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
64+
65+
singlehtml:
66+
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
67+
@echo
68+
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
69+
70+
pickle:
71+
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
72+
@echo
73+
@echo "Build finished; now you can process the pickle files."
74+
75+
json:
76+
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
77+
@echo
78+
@echo "Build finished; now you can process the JSON files."
79+
80+
htmlhelp:
81+
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
82+
@echo
83+
@echo "Build finished; now you can run HTML Help Workshop with the" \
84+
".hhp project file in $(BUILDDIR)/htmlhelp."
85+
86+
qthelp:
87+
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
88+
@echo
89+
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
90+
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
91+
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/rabit.qhcp"
92+
@echo "To view the help file:"
93+
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/rabit.qhc"
94+
95+
applehelp:
96+
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
97+
@echo
98+
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
99+
@echo "N.B. You won't be able to view it unless you put it in" \
100+
"~/Library/Documentation/Help or install it in your application" \
101+
"bundle."
102+
103+
devhelp:
104+
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
105+
@echo
106+
@echo "Build finished."
107+
@echo "To view the help file:"
108+
@echo "# mkdir -p $$HOME/.local/share/devhelp/rabit"
109+
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/rabit"
110+
@echo "# devhelp"
111+
112+
epub:
113+
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
114+
@echo
115+
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
116+
117+
latex:
118+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
119+
@echo
120+
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
121+
@echo "Run \`make' in that directory to run these through (pdf)latex" \
122+
"(use \`make latexpdf' here to do that automatically)."
123+
124+
latexpdf:
125+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
126+
@echo "Running LaTeX files through pdflatex..."
127+
$(MAKE) -C $(BUILDDIR)/latex all-pdf
128+
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
129+
130+
latexpdfja:
131+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
132+
@echo "Running LaTeX files through platex and dvipdfmx..."
133+
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
134+
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
135+
136+
text:
137+
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
138+
@echo
139+
@echo "Build finished. The text files are in $(BUILDDIR)/text."
140+
141+
man:
142+
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
143+
@echo
144+
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
145+
146+
texinfo:
147+
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
148+
@echo
149+
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
150+
@echo "Run \`make' in that directory to run these through makeinfo" \
151+
"(use \`make info' here to do that automatically)."
152+
153+
info:
154+
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
155+
@echo "Running Texinfo files through makeinfo..."
156+
make -C $(BUILDDIR)/texinfo info
157+
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
158+
159+
gettext:
160+
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
161+
@echo
162+
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
163+
164+
changes:
165+
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
166+
@echo
167+
@echo "The overview file is in $(BUILDDIR)/changes."
168+
169+
linkcheck:
170+
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
171+
@echo
172+
@echo "Link check complete; look for any errors in the above output " \
173+
"or in $(BUILDDIR)/linkcheck/output.txt."
174+
175+
doctest:
176+
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
177+
@echo "Testing of doctests in the sources finished, look at the " \
178+
"results in $(BUILDDIR)/doctest/output.txt."
179+
180+
coverage:
181+
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
182+
@echo "Testing of coverage in the sources finished, look at the " \
183+
"results in $(BUILDDIR)/coverage/python.txt."
184+
185+
xml:
186+
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
187+
@echo
188+
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
189+
190+
pseudoxml:
191+
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
192+
@echo
193+
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."

vta/docs/README.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
The documentation of vta is generated with recommonmark and sphinx.
2+
3+
- pip install sphinx>=1.5.5 sphinx-gallery sphinx_rtd_theme matplotlib Image recommonmark
4+
- Type "make html" to generate the doc
5+
- If we only want to build doxygen docs: at project root, type "make doc"

vta/docs/_static/css/tvm_theme.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.rst-content .hidden-section {
2+
display: none;
3+
}
4+
5+
.rst-toc .hidden-section {
6+
display: none;
7+
}
8+
9+
nav .hidden-section {
10+
display: inherit;
11+
}

vta/docs/api_links.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Links to API References
2+
=======================
3+
4+
This page contains links to API references that are build with different doc build system.
5+
6+
* `C++ doyxgen API <doxygen/index.html>`_

0 commit comments

Comments
 (0)