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

[Op] Add math operations #497

Closed zzzDavid closed 1 year ago

zzzDavid commented 1 year ago

Summary

This PR adds support for math operations including expr, pow, log, log2, log10, sin, cos, tanh.

Changes

Limitation

hcl.tan is not available at the moment. This is because LLVM 15.0 misses this rewrite pattern: populateExpandTanPattern. hcl.tan will be added in future releases after we bump LLVM version.

zzzDavid commented 1 year ago

Test cases will be added by William's PR: https://github.com/cornell-zhang/heterocl/pull/476

zzzDavid commented 1 year ago

Yes, I added the lowering passes of math ops before our first release, this PR just adds the front-end support, so there are no changes required in the IR system.