You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-31Lines changed: 25 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,37 +8,31 @@ Hello, world!
8
8
=====
9
9
One of the primary design goals of VecPy is *simplicity*. In just a few lines of code, VecPy translates and compiles a Python function into an efficient, data-parallel native library. The generated library can then be loaded as a Python module, allowing the optimized function to be used as a drop-in replacement for the original Python function. The following program illustrates how simple it can be to use VecPy to significantly improve Python program performance.
10
10
```python
11
-
#Import VecPy and other modules
12
-
from parser import Parser
13
-
from compiler import Compiler
14
-
from compiler_constants import*
15
-
from array import array
16
-
from random import uniform
11
+
#Import VecPy
12
+
from vecpy.runtime import*
13
+
from vecpy.compiler_constants import*
17
14
18
15
#Define the kernel
19
-
defshapes(radius, edge, vol_sphere, vol_icos):
20
-
"""Calculates sphere and an icosahedron volumes."""
#Import the newly-minted module and execute kernel
30
+
from vecpy_volume import volume
31
+
volume(radii, volumes)
32
+
33
+
#Print the results!
34
+
print('Radius:', ', '.join('%.3f'%(r) for r in radii))
35
+
print('Volume:', ', '.join('%.3f'%(v) for v in volumes))
42
36
```
43
37
44
38
Features and Functionality
@@ -48,10 +42,10 @@ Other design goals of VecPy include *utility*, *flexibility*, and *efficiency*.
48
42
VecPy aims to implement a sufficiently large feature set to be useful for meaningful, real-world applications. Conditional operations within `if-elif-else` blocks and `while` loops are fully implemented, and the following Python operators, functions, and constants are currently available:
0 commit comments