cornell-zhang / heterocl

HeteroCL: A Multi-Paradigm Programming Infrastructure for Software-Defined Heterogeneous Computing
https://cornell-zhang.github.io/heterocl/
Apache License 2.0
322 stars 92 forks source link

[API] Add support for getting bit/slice from expressions #236

Closed seanlatias closed 4 years ago

seanlatias commented 4 years ago

In this PR, we enable getting bit/slice from expressions.

A = hcl.placeholder((10,))
B = hcl.compute(A.shape, lambda x: (A[x]+1)[5])

For more examples, please refer to tests/test_dsl_basic.py.

seanlatias commented 4 years ago

Setting bit/slice to expressions is not allowed. An error message would pop out.