File tree 3 files changed +22
-0
lines changed
3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,9 @@ inst/bin/*
89
89
* _ldd.txt
90
90
* _lines.dat.txt
91
91
* __tmp__generated__.c
92
+ a.c
93
+ a.h
94
+ a.py
92
95
93
96
# ## https://raw.github.com/github/gitignore/218a941be92679ce67d0484547e3e142b2f5f6f0/Global/macOS.gitignore
94
97
Original file line number Diff line number Diff line change @@ -534,3 +534,6 @@ RUN(NAME callback_01 LABELS cpython llvm)
534
534
RUN(NAME intrinsics_01 LABELS cpython llvm) # any
535
535
536
536
COMPILE(NAME import_order_01 LABELS cpython llvm c) # any
537
+
538
+ # Jit
539
+ RUN(NAME test_jit_01 LABELS cpython)
Original file line number Diff line number Diff line change
1
+ from numpy import array
2
+ from lpython import i32 , f64 , jit
3
+
4
+ @jit
5
+ def fast_sum (n : i32 , x : f64 [:]) -> f64 :
6
+ s : f64 = 0.0
7
+ i : i32
8
+ for i in range (n ):
9
+ s += x [i ]
10
+ return s
11
+
12
+ def test ():
13
+ x : f64 [3 ] = array ([1.0 , 2.0 , 3.0 ])
14
+ assert fast_sum (3 , x ) == 6.0
15
+
16
+ test ()
You can’t perform that action at this time.
0 commit comments