lyken
11824e9420
core/ndstrides: add ScalarOrNDArray::get_dtype
2024-08-20 23:31:53 +08:00
lyken
0c6ba9fd6b
core/ndstrides: add NDArrayOut, broadcast_map and map
2024-08-20 23:31:49 +08:00
lyken
9173e52435
core/ndstrides: add ScalarOrNDArray::to_ndarray and NDArrayObject::make_unsized
2024-08-20 23:31:48 +08:00
lyken
0ccae59b19
core/ndstrides: add TryFrom impls for ScalarOrNDArray
2024-08-20 23:31:34 +08:00
lyken
6fe17c71e3
core/ndstrides: implement np_transpose() (no axes argument)
2024-08-20 23:31:29 +08:00
lyken
22d9aac930
core/ndstrides: implement np_reshape()
2024-08-20 23:31:28 +08:00
lyken
578b53d8ce
core: categorize np_{transpose,reshape} as 'view functions'
2024-08-20 23:31:26 +08:00
lyken
b216c82875
core/ndstrides: implement np_size()
2024-08-20 23:31:23 +08:00
lyken
5c5dc66016
cargo fmt nac3artiq/src/codegen.rs
2024-08-20 23:31:17 +08:00
lyken
dae0eff771
core/ndstrides: implement np_shape() and np_strides()
...
These functions are not important, but they are handy for debugging +
implementing them takes little effort.
NOTE: `np.strides()` is not an actual NumPy function. You can only(?)
access them thru `ndarray.strides`.
2024-08-20 23:31:04 +08:00
lyken
0d1380b4d4
core/ndstrides: implement ndarray.fill() and .copy()
2024-08-20 23:30:06 +08:00
lyken
d94feb1424
core/ndstrides: implement np_identity() and np_eye()
2024-08-20 23:29:53 +08:00
lyken
632f736fac
core/ndstrides: implement np_array()
...
It also checks for inconsistent dimensions if the input is a list.
e.g., rejecting `[[1.0, 2.0], [3.0]]`. Previously it was a todo of
`np_array()`.
2024-08-20 23:29:45 +08:00
lyken
f44b361ec1
core/ndstrides: add NDArrayObject::atleast_nd
2024-08-20 23:29:44 +08:00
lyken
ff48f9549a
core/ndstrides: add NDArrayObject::make_copy
2024-08-20 23:29:43 +08:00
lyken
171283c0bb
core/irrt: add List
...
Needed for implementing np_array()
2024-08-20 23:29:29 +08:00
lyken
aca2305bfb
core/codegen: implement genereal ndarray indexing
...
`...`, `none` are now also supported.
2024-08-20 23:29:24 +08:00
lyken
4660d553de
core/irrt: rename NDIndex to NDIndexInt
...
The name `NDIndex` is used in later commits.
2024-08-20 23:29:23 +08:00
lyken
c20736307d
core/irrt: add Slice and ResolvedSlice
...
Needed for implementing general ndarray indexing
2024-08-20 23:29:22 +08:00
lyken
2fe0611733
core/codegen: refactor call_len() & update to ndarray with strides
2024-08-20 23:29:08 +08:00
lyken
e7846d9cd9
core/ndstrides: implement ndarray np_{zeros,ones,full,empty}
2024-08-20 23:29:07 +08:00
lyken
c6c07e074a
core/object: add is_instance for ndarray, tuple and list
2024-08-20 23:28:54 +08:00
lyken
de9f4775d5
core/model: add util::gen_for_model
2024-08-20 23:28:52 +08:00
lyken
7ad7918f11
core/object: add ListObject and TupleObject
...
Needed for implementing other ndarray utils.
2024-08-20 23:28:43 +08:00
lyken
5113c12b8b
core/ndstrides: add ndarray iterator
2024-08-20 17:03:51 +08:00
lyken
51740c6c90
core/ndstrides: add basic ndarray utilities
2024-08-20 17:03:51 +08:00
lyken
f090b3b4d2
core/ndstrides: define ndarray with strides
2024-08-20 17:03:51 +08:00
lyken
9d8cc0c59d
core/toplevel/helper: add {extract,create}_ndims
2024-08-20 17:03:51 +08:00
lyken
5f4486bbbb
core/object: introduce object
...
Small abstraction to simplify implementations.
2024-08-20 17:03:50 +08:00
lyken
d98919fdf9
core/model: introduce models
2024-08-20 15:35:47 +08:00
lyken
82c4908305
core/fix: add missing lifetime in gen_for*
2024-08-20 15:35:47 +08:00
lyken
7436ce8ba8
core/fix: stringify type in expected concrete type error
2024-08-20 15:35:47 +08:00
lyken
eb1dee81d0
core/irrt/exceptions: add debug utils with exceptions
2024-08-20 15:35:47 +08:00
lyken
61ecbb4e47
core/irrt/exceptions: allow irrt to raise exceptions
2024-08-20 15:35:47 +08:00
lyken
dcd9010dd1
core/irrt: split irrt.cpp into headers
2024-08-20 15:35:47 +08:00
lyken
f742b303ab
core/irrt: build.rs capture IR defined constants
2024-08-20 15:35:47 +08:00
lyken
bc595d3552
core/irrt: build.rs capture IR defined types
2024-08-20 15:35:47 +08:00
lyken
290e6b97d2
core/irrt: reformat
2024-08-20 15:35:47 +08:00
lyken
472bc25f4c
core: add .clang-format
2024-08-20 15:35:47 +08:00
lyken
9b3790631d
core/irrt: comment build.rs & move irrt to its own dir
...
To prepare for future IRRT implementations, and to also make cargo
only have to watch a single directory.
2024-08-20 15:35:47 +08:00
Sebastien Bourdeauducq
0fc26df29e
flake: update nixpkgs
2024-08-19 23:53:15 +08:00
David Mak
0b074c2cf2
[artiq] symbol_resolver: Set private linkage for constants
2024-08-19 14:41:43 +08:00
Sébastien Bourdeauducq
a0f6961e0e
cargo: update dependencies
2024-08-19 13:15:03 +08:00
David Mak
b1c5c2e1d4
[artiq] Fix RPC of ndarrays to host
2024-08-15 15:41:24 +08:00
David Mak
69320a6cf1
[artiq] Fix LLVM representation of strings
...
Should be `%str` rather than `[N x i8]`.
2024-08-14 09:30:08 +08:00
David Mak
9e0601837a
core: Add compile-time feature to disable escape analysis
2024-08-14 09:29:48 +08:00
lyken
432c81a500
core: update insta after #489
2024-08-13 15:30:34 +08:00
David Mak
6beff7a268
[artiq] Implement core_log and rtio_log in terms of polymorphic_print
...
Implementation mostly references the original implementation in Python.
2024-08-13 15:19:03 +08:00
David Mak
6ca7aecd4a
[artiq] Add core_log and rtio_log function declarations
2024-08-13 15:19:03 +08:00
David Mak
8fd7216243
[core] toplevel/composer: Add lateinit_builtins
...
This is required for the new core_log and rtio_log functions, which take
a generic type as its parameter. However, in ARTIQ builtins are
initialized using one unifier and then actually used by another unifier.
lateinit_builtins workaround this issue by deferring the initialization
of functions requiring type variables until the actual unifier is ready.
2024-08-13 15:19:03 +08:00