Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.

Commit 5f96914

Browse files
author
Ehsan Totoni
committed
docs no supported
1 parent 95c37d8 commit 5f96914

3 files changed

Lines changed: 41 additions & 2 deletions

File tree

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ HPAT documentation
1212

1313
source/overview
1414
source/supported
15+
source/notsupported

docs/source/notsupported.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
.. _notsupported:
2+
3+
Not Supported Python Programs
4+
=============================
5+
6+
HPAT statically compiles user codes to generate efficient parallel programs.
7+
Hence, the user code needs to be `statically compilable`.
8+
This means that HPAT should be able to infer all the variable types, and be able
9+
to analyze the computations.
10+
11+
Type Stability
12+
--------------
13+
14+
To enable type inference, the program should be `type stable`, which means every
15+
variable should have a single type. The example below is not type stable since
16+
variable ``a`` can be both a float and an array of floats::
17+
18+
if flag:
19+
a = 1.0
20+
else:
21+
a = np.ones(10)
22+
23+
The use of ``isinstance`` operator of Python often means type instabillity and
24+
is not supported.
25+
26+
Similarly, function calls should also be deterministic. The below example is
27+
not supported since function ``f`` is not known in advance::
28+
29+
if flag:
30+
f = np.zeros
31+
else:
32+
f = np.random.ranf
33+
A = f(10)
34+
35+
One can usually avoid these cases in numerical code without significant effort.

docs/source/supported.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
.. _supported:
22

3-
Supported Python Programs
4-
=========================
3+
User Guide
4+
==========
5+
6+
HPAT supports a subset of Python that is commonly used for data analytics and
7+
machine learning. This section describes this subset.
58

69
HPAT compiles and parallelizes the functions annotated with the `@hpat.jit`
710
decorator. Therefore, file I/O and computations on large datasets should be

0 commit comments

Comments
 (0)