This repository was archived by the owner on Feb 2, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,3 +12,4 @@ HPAT documentation
1212
1313 source/overview
1414 source/supported
15+ source/notsupported
Original file line number Diff line number Diff line change 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.
Original file line number Diff line number Diff line change 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
69HPAT compiles and parallelizes the functions annotated with the `@hpat.jit `
710decorator. Therefore, file I/O and computations on large datasets should be
You can’t perform that action at this time.
0 commit comments