Skip to content

Commit

Permalink
Replace alternative CPP operators, see issue #297 (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
KOVI89alipes authored Apr 16, 2021
1 parent b0b86de commit 860b130
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hls4ml/templates/vivado/nnet_utils/nnet_mult.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ class weight_exponential : public Product<x_T, w_T, y_T>{

template<class data_T, class res_T, typename CONFIG_T>
inline typename std::enable_if<std::is_same<data_T, ap_uint<1>>::value
and std::is_same<typename CONFIG_T::weight_t, ap_uint<1>>::value, ap_int<nnet::ceillog2(CONFIG_T::n_in) + 2>>::type
&& std::is_same<typename CONFIG_T::weight_t, ap_uint<1>>::value, ap_int<nnet::ceillog2(CONFIG_T::n_in) + 2>>::type
cast(typename CONFIG_T::accum_t x){
return (ap_int<nnet::ceillog2(CONFIG_T::n_in) + 2>) (x - CONFIG_T::n_in / 2) * 2;
}

template<class data_T, class res_T, typename CONFIG_T>
inline typename std::enable_if<(not std::is_same<data_T, ap_uint<1>>::value), res_T>::type
inline typename std::enable_if<(! std::is_same<data_T, ap_uint<1>>::value), res_T>::type
cast(typename CONFIG_T::accum_t x){
return (res_T) x;
}
Expand Down

0 comments on commit 860b130

Please sign in to comment.