File tree Expand file tree Collapse file tree 3 files changed +25
-8
lines changed Expand file tree Collapse file tree 3 files changed +25
-8
lines changed Original file line number Diff line number Diff line change @@ -40,8 +40,6 @@ coverage.xml
4040.pytest_cache /
4141
4242# documentation build artifacts
43-
44- docs /* .md
4543docs /api
4644site /
4745mkdocs.yml
Original file line number Diff line number Diff line change 1+ Documentation
2+ ==========
3+
4+ We use [ ` Sphinx ` ] ( https://www.sphinx-doc.org/en/master/index.html ) for presenting our documentation.
5+
6+ To build the docs follow these steps:
7+
8+ 1 . Install the required sphinx packages and extensions from the [ requirements.txt] ( ../requirements.txt )
9+ ``` sh
10+ pip install -r requirements.txt # install sphinx and its extensions
11+ ```
12+ 2 . Build docs using sphinx
13+ ``` sh
14+ sphinx-build -M html docs/ output-docs/ # builds docs as html files stored in output-docs
15+ ```
16+ 3 . Explore the docs starting at ` output-docs/index.html `
17+
Original file line number Diff line number Diff line change 55# removed, then the execution of this code would be equivalent to the
66# following function.
77
8- def pi_no_jit (x , y , temp , samples ):
8+ import arrayfire as af
9+
10+ def pi_no_jit (x , y , samples ):
911 temp = x * x
1012 temp .eval ()
1113 temp += y * y
1214 temp .eval ()
13- temp = sqrt (temp )
15+ temp = af . sqrt (temp )
1416 temp .eval ()
1517 temp = temp < 1
1618 temp .eval ()
17- return 4.0 * sum (temp ) / samples
19+ return 4.0 * af . sum (temp ) / samples
1820
19- def pi_jit (x , y , temp , samples ):
20- temp = sqrt (x * x + y * y ) < 1
21+ def pi_jit (x , y , samples ):
22+ temp = af . sqrt (x * x + y * y ) < 1
2123 temp .eval ()
22- return 4.0 * sum (temp ) / samples
24+ return 4.0 * af . sum (temp ) / samples
2325
2426# [jit-endsnippet]
You can’t perform that action at this time.
0 commit comments