-
Notifications
You must be signed in to change notification settings - Fork 22
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
Lookup Tables for Trigonometric Functions #19
Comments
One way to generate a lookup table for this is treating fy_f and fx_f as taps. If you don't put them into the input argument lists for accelerate_at, for example, you can just write accelerate_at({Input}, ...), then fy_f and fx_f will be generated as taps. In HLS, you will see stencils corresponding to these two taps. You can take a look at conv_hls example for how taps are generated. Note, by default stencils have been partitioned completely, so they are implemented as registers, but if you remove the array_partition pragma for those stencils in HLS code, vivado_hls will generate lookup table for these stencils. Let me know if that is not clear. |
@xuanyoya Thanks! |
@amisal88 The ROM optimization mentioned in the paper is implemented by inferring from an |
Dear all,
Regarding constant function optimization, in the Halide-HLS paper (Programming Heterogeneous Systems from an Image Processing DSL), it has been declared that:
There are some examples in hls_examples directory of Halide-HLS (e.g. unsharp_hls) that use exponential function in a reduction domain, and the values for that exponential function is replaced with constants in generated HLS code.
I am trying to infer look up tables for sin(x) and cos(y) in the following code:
It seems that there are sin_f32() and cos_f32() functions in the generated HLS code, which receive their arguments from loops indexes, and Vivado HLS does not use lookup tables for those functions, eventhough the loop indexes are known.
I know we can use constant arrays which have been evaluated on corresponding indexes of sin() and cos() in Halide code instead of using those functions explicitly. But I wonder can Halide-HLS compiler generate lookup tables directly for those functions, not just in reduction domain manner as it does in unsharp_hls example. Is there a Halide primitive that can be used in this situation?
Thanks!
The text was updated successfully, but these errors were encountered: