From 4a8306e92918155a8db3c0ecffd165d0d250e895 Mon Sep 17 00:00:00 2001 From: Nikolaos Kavvadias Date: Fri, 12 Mar 2021 12:57:30 +0100 Subject: [PATCH 1/2] Compilation fixes for clang --- include/ac_math/ac_pow_pwl.h | 2 +- include/ac_math/ac_sqrt_pwl.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/ac_math/ac_pow_pwl.h b/include/ac_math/ac_pow_pwl.h index 9a5dc99..bd74bb2 100644 --- a/include/ac_math/ac_pow_pwl.h +++ b/include/ac_math/ac_pow_pwl.h @@ -296,7 +296,7 @@ namespace ac_math { const ac_fixed<17, 3, true> log2e = 1.44269504089; // Find type of intermediate variable used to store output of x*log2(e) - typedef class comp_pii_exp::pit_t input_inter_type; + typedef typename comp_pii_exp::pit_t input_inter_type; input_inter_type input_inter; // e^x = 2^(x*log2(e)) input_inter = input*log2e; diff --git a/include/ac_math/ac_sqrt_pwl.h b/include/ac_math/ac_sqrt_pwl.h index fcf318d..2800978 100644 --- a/include/ac_math/ac_sqrt_pwl.h +++ b/include/ac_math/ac_sqrt_pwl.h @@ -457,14 +457,14 @@ namespace ac_math void ac_sqrt_pwl (const ac_complex > input, ac_complex > &output) { // Calculate parameterized bitwidths for all intermediate types. - typedef class find_rt_sqrt_pwl<(2*(W - I)), (2*I - 1)>::rt_sqrt_pwl sqrt_mod_type; + typedef typename find_rt_sqrt_pwl<(2*(W - I)), (2*I - 1)>::rt_sqrt_pwl sqrt_mod_type; const int W1 = sqrt_mod_type::width; const int I1 = sqrt_mod_type::i_width; const int n_f_b_1 = W1 - I1; const int t_I = I + 1; const int t_n_f_b = (W - I) > n_f_b_1 ? W - I : n_f_b_1; const int t_W = t_I + t_n_f_b; - typedef class find_rt_sqrt_pwl::rt_sqrt_pwl x_y_type; + typedef typename find_rt_sqrt_pwl::rt_sqrt_pwl x_y_type; const int W2 = x_y_type::width; const int I2 = x_y_type::i_width; From 7a03e051385b4ad572beb9e74d3b6c0a17311b40 Mon Sep 17 00:00:00 2001 From: Nikolaos Kavvadias Date: Fri, 12 Mar 2021 12:58:06 +0100 Subject: [PATCH 2/2] pragma unroll -> hls_unroll for clang compatibility --- include/ac_math/ac_determinant.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/ac_math/ac_determinant.h b/include/ac_math/ac_determinant.h index 4ef2b1a..f19696d 100644 --- a/include/ac_math/ac_determinant.h +++ b/include/ac_math/ac_determinant.h @@ -214,14 +214,14 @@ namespace ac_math temp_type temp; // PIVOT loop to keep track of pivot (element about which minor is to be computed) -#pragma unroll yes +#pragma hls_unroll yes PIVOT: for (unsigned j=0; j, M, M > a_temp; -#pragma unroll yes +#pragma hls_unroll yes ROW_CPY: for (unsigned i = 0; i < M; i++) { -#pragma unroll yes +#pragma hls_unroll yes COLUMN_CPY: for (unsigned j = 0; j < M; j++) { a_temp (i,j) = a[i][j]; @@ -427,10 +427,10 @@ namespace ac_math void ac_determinant (const ac_complex > a[M][M], ac_complex > &result) { ac_matrix < ac_complex >, M, M > a_temp; -#pragma unroll yes +#pragma hls_unroll yes ROW_CPY: for (unsigned i = 0; i < M; i++) { -#pragma unroll yes +#pragma hls_unroll yes COLUMN_CPY: for (unsigned j = 0; j < M; j++) { a_temp (i,j) = a[i][j];