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] Enhancement on Data Movement APIs #321

Closed hecmay closed 3 years ago

hecmay commented 3 years ago

Enhance .to primitive

Enhance HCL runtime and build APIs

Bugs fixing

hecmay commented 3 years ago

@zzzDavid Please see this example for streaming between HCL modules: https://github.com/Hecmay/heterocl/blob/fix/tests/test_schedule_systolic.py#L132-L156

I updated the API to be user-friendly and intuitive:

# Stream module add's B port to module mul's B port
s.to(kernel.add.B, kernel.mul.B)

The underlying IR pass will check the legality of the primitive: it has to be one-read-one-write.