Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge main into list_reverse #2

Merged
merged 94 commits into from
May 14, 2023
Merged
Changes from 1 commit
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
f776fdd
PKG: Move normalize funcs to utils pkg
Shaikh-Ubaid Apr 27, 2023
1f7932e
PKG: Add regression and its test
Shaikh-Ubaid Apr 27, 2023
6111d46
PKG: Fixes in lpdraw
Shaikh-Ubaid Apr 27, 2023
dac940b
ASR: Support modules in pickle_json()
Shaikh-Ubaid Apr 27, 2023
8506de2
TEST: Enable test and update ref tests
Shaikh-Ubaid Apr 27, 2023
a40eebe
Register ``Partition`` in IntrinsicFunction (#1673)
Thirumalai-Shaktivel May 3, 2023
51ad8b4
Improve performance of ``exp()`` and ``exp2()`` (#1712)
gptsarthak May 3, 2023
269345b
Merge pull request #1752 from Shaikh-Ubaid/asr_json_modules
certik May 4, 2023
d2bf0f1
Merge pull request #1751 from Shaikh-Ubaid/regression_pkg
certik May 4, 2023
2bea899
lpython: Support auto conversion
Shaikh-Ubaid May 4, 2023
4c28bc9
TEST: Update tests to use just i32()
Shaikh-Ubaid May 4, 2023
87cb5d6
TEST: Add and enable test ...
Shaikh-Ubaid May 4, 2023
05bde7d
TEST: Update reference tests
Shaikh-Ubaid May 4, 2023
df30c8b
WASM_X64: Support visit_I32TruncF64S()
Shaikh-Ubaid May 4, 2023
e432e7a
Merge pull request #1761 from Shaikh-Ubaid/fix_types
Shaikh-Ubaid May 5, 2023
3117c4e
Keep strings unescaped in AST, ASR
Shaikh-Ubaid May 6, 2023
7ef0b66
Make unescape_string() work with Str
Shaikh-Ubaid May 6, 2023
52419e8
Escape strings while printing
Shaikh-Ubaid May 6, 2023
f1def7d
Support ', \r, \newline in unescape_string()
Shaikh-Ubaid May 6, 2023
736f536
Escape \t and \r in C, CPP
Shaikh-Ubaid May 6, 2023
8cb00d1
Unescape byte strings
Shaikh-Ubaid May 6, 2023
ae7ac94
TEST: Add test case
Shaikh-Ubaid May 6, 2023
ad5a1db
TEST: Update reference tests
Shaikh-Ubaid May 6, 2023
bf59fb4
Merge pull request #1762 from Shaikh-Ubaid/asr_unescaped_strings
Shaikh-Ubaid May 7, 2023
e021e78
CI: PIP: Update test to work with latest pkg
Shaikh-Ubaid May 7, 2023
5282b76
Use pip installed lpython
Shaikh-Ubaid May 8, 2023
9cc155c
Pin specific version
Shaikh-Ubaid May 9, 2023
8d09615
Merge pull request #1763 from Shaikh-Ubaid/fix_ci
Shaikh-Ubaid May 9, 2023
8110bcb
ASR: Support UnaryOp in attr bit_length()
Shaikh-Ubaid May 9, 2023
1cb36e8
TEST: Add test
Shaikh-Ubaid May 9, 2023
450b560
C_CPP: Fix codegen for multiple unaryop
Shaikh-Ubaid May 9, 2023
a04d456
Merge pull request #1768 from Shaikh-Ubaid/fix_bit_len2
Shaikh-Ubaid May 10, 2023
73bd468
Throw an error when jit decorator is compiled using LPython
Thirumalai-Shaktivel May 10, 2023
cb72471
Jit Baseline implementation,
Thirumalai-Shaktivel May 10, 2023
1fd75d9
Generate a C file with the Python wrappers using Python C/API,
Thirumalai-Shaktivel May 10, 2023
bf0a910
Compile the C template with the LPython generated C file and create a…
Thirumalai-Shaktivel May 10, 2023
3c5909d
Import the shared library and return the function call
Thirumalai-Shaktivel May 10, 2023
a5eda0c
Add CPython test and register in CMakeLists
Thirumalai-Shaktivel May 10, 2023
25b45ac
Add unsigned int types
Smit-create May 8, 2023
50e0739
Add a test for unsigned integers
certik May 10, 2023
1bd2f93
ASR: fix a typo in UnsignedIntegerConstant
certik May 10, 2023
248725b
Frontend: Add support for unsigned integers
certik May 10, 2023
1ca113f
Backend: add support for unsigned integers
certik May 10, 2023
40e7778
Merge pull request #1764 from Smit-create/i-1588
czgdp1807 May 10, 2023
e14cc37
Add unsigned integer support to C backend
certik May 10, 2023
eb5a906
Add a test for all unsigned types
certik May 10, 2023
9028f68
Merge pull request #1769 from certik/uint2
certik May 10, 2023
9d965a8
Merge pull request #1708 from harshsingh-24/jit
certik May 10, 2023
305f096
Merge pull request #1770 from certik/uint3
certik May 10, 2023
9b5ec2e
Implement --get-rtl-dir
certik May 10, 2023
e9453fd
Merge pull request #1772 from certik/rtl
certik May 10, 2023
5562678
Implement unsigned arrays support
certik May 10, 2023
9b8fa1e
Merge pull request #1775 from certik/uint4
certik May 10, 2023
d1535f4
ASR: Support array.size attribute
Shaikh-Ubaid May 11, 2023
46d283d
ASR: Support numpy size()
Shaikh-Ubaid May 11, 2023
6c6043b
TEST: Add test for array.size
Shaikh-Ubaid May 11, 2023
c900f7d
TEST: Update reference tests
Shaikh-Ubaid May 11, 2023
ff38f75
Merge pull request #1777 from Shaikh-Ubaid/numpy_size
certik May 11, 2023
a0441aa
Add support for AST/R Visualization
Shaikh-Ubaid May 11, 2023
d2420d7
Add --no-indent flag
Shaikh-Ubaid May 11, 2023
bbcec15
Revert "TEST: Indent all AST and ASR tests"
Shaikh-Ubaid May 11, 2023
8d1c9c3
TEST: Update reference tests
Shaikh-Ubaid May 11, 2023
8c71d37
Merge pull request #1779 from Shaikh-Ubaid/visualize_and_indent
certik May 11, 2023
6e57da7
ASR: Fix numpy size() dim field
Shaikh-Ubaid May 11, 2023
5329920
TEST: Add test for numpy size()
Shaikh-Ubaid May 11, 2023
144a50d
Merge pull request #1780 from Shaikh-Ubaid/numpy_size_test_case
certik May 11, 2023
6728f50
Rename the @jit decorator to @lpython
certik May 12, 2023
86fde94
Merge pull request #1791 from certik/lpython_dec
certik May 12, 2023
0f19593
ASR: Skip if in SymbolTableVisitor
Shaikh-Ubaid May 12, 2023
9ef4123
TEST: Add test for if in global scope
Shaikh-Ubaid May 12, 2023
797f1ba
Allow importing enums
Smit-create May 12, 2023
3be64d2
Add tests
Smit-create May 12, 2023
99b48f6
Merge pull request #1792 from Shaikh-Ubaid/skip_if
Shaikh-Ubaid May 12, 2023
37827ef
Rename `jit` to `lpython`
Thirumalai-Shaktivel May 12, 2023
a4df75c
Move import statements within the lpython class
Thirumalai-Shaktivel May 12, 2023
42e0f59
Merge pull request #1794 from Smit-create/i-1783
Smit-create May 12, 2023
cf1160b
Update array indexing to use strides and offsets (#1765)
czgdp1807 May 12, 2023
a77b337
Fix module imports for subroutines
Smit-create May 12, 2023
6d08cff
Add tests
Smit-create May 12, 2023
a9e9a33
Use get_python_lib to get lib path
Thirumalai-Shaktivel May 12, 2023
8472ea4
Import only once
Smit-create May 12, 2023
d48b523
Use unique name for the lpython decorator generated files
Thirumalai-Shaktivel May 12, 2023
0154fc3
Use unique name for shared library
Thirumalai-Shaktivel May 12, 2023
20d9536
Merge pull request #1795 from Smit-create/i-1782
certik May 12, 2023
bb8bfe7
Merge pull request #1796 from Thirumalai-Shaktivel/lpython_decorator
certik May 12, 2023
b9850da
Support ``bool`` typed keys in ``dict`` (#1771)
kabra1110 May 13, 2023
c85d000
ASR: Error on missing struct initialization
Shaikh-Ubaid May 13, 2023
7f7dbde
ASRUtils: also print type name along with symbol name
Shaikh-Ubaid May 13, 2023
abdb697
TEST: Add test for struct with no init_expr
Shaikh-Ubaid May 13, 2023
d0cd19b
TEST: Update tests to add struct init
Shaikh-Ubaid May 13, 2023
8dcdcbe
ASR: Skip visit_Call() in SymbolTableVisitor
Shaikh-Ubaid May 13, 2023
bf6ef8f
TEST: Update reference tests
Shaikh-Ubaid May 13, 2023
9941f2c
Merge pull request #1808 from Shaikh-Ubaid/struct_init_expr
Shaikh-Ubaid May 14, 2023
04e544b
Merge branch 'list_reverse' into list_reverse_tmp
kabra1110 May 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move import statements within the lpython class
  • Loading branch information
Thirumalai-Shaktivel committed May 12, 2023
commit a4df75c0e11d52db394be11b8ed1acbc54f6dcb3
7 changes: 5 additions & 2 deletions src/runtime/lpython/lpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import platform
from dataclasses import dataclass as py_dataclass, is_dataclass as py_is_dataclass
from goto import with_goto
from numpy import get_include
from distutils.sysconfig import get_python_inc

# TODO: this does not seem to restrict other imports
__slots__ = ["i8", "i16", "i32", "i64", "u8", "u16", "u32", "u64", "f32", "f64", "c32", "c64", "CPtr",
Expand Down Expand Up @@ -728,19 +726,24 @@ def get_data_type(t):
# TODO: Use LLVM instead of C backend
r = os.system("lpython --show-c --disable-main a.py > a.h")
assert r == 0, "Failed to create C file"

gcc_flags = ""
if platform.system() == "Linux":
gcc_flags = " -shared -fPIC "
elif platform.system() == "Darwin":
gcc_flags = " -bundle -flat_namespace -undefined suppress "
else:
raise NotImplementedError("Platform not implemented")

from numpy import get_include
from distutils.sysconfig import get_python_inc
python_path = "-I" + get_python_inc() + " "
numpy_path = "-I" + get_include()
rt_path_01 = "-I" + get_rtlib_dir() + "/../libasr/runtime "
rt_path_02 = "-L" + get_rtlib_dir() + " -Wl,-rpath " \
+ get_rtlib_dir() + " -llpython_runtime "
python_lib = "-L" "$CONDA_PREFIX/lib/ -lpython3.10 -lm"

r = os.system("gcc -g" + gcc_flags + python_path + numpy_path +
" a.c -o lpython_jit_module.so " + rt_path_01 + rt_path_02 + python_lib)
assert r == 0, "Failed to create the shared library"
Expand Down