Skip to content

Commit

Permalink
Merge pull request #9 from cms-hls4ml/fix_namespace
Browse files Browse the repository at this point in the history
fix namespace
  • Loading branch information
thesps authored Mar 22, 2024
2 parents 0a15edf + 3fd2dcc commit bc64def
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions AXOL1TL_v1/GTADModel_emulator_v1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class GTADModel_emulator_v1 : public hls4mlEmulator::Model {
{
for (int i = 0; i < N_INPUT_1_1; i++)
{
unscaled_t tmp0 = unscaled[i] - ad_offsets[i];
input_t tmp1 = tmp0 >> ad_shift[i];
unscaled_t tmp0 = unscaled[i] - hls4ml_axol1tl_v1::ad_offsets[i];
input_t tmp1 = tmp0 >> hls4ml_axol1tl_v1::ad_shift[i];
scaled[i] = tmp1;
}
}
Expand Down
3 changes: 2 additions & 1 deletion AXOL1TL_v1/scales.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "NN/GTADModel_v1.h"

//N_INPUT_1_1=AD_NNNINPUTS
namespace hls4ml_axol1tl_v1{
typedef ap_fixed<5,5> ad_shift_t;
typedef ap_fixed<10,9> ad_offset_t;

Expand All @@ -19,5 +20,5 @@ static const ad_offset_t ad_offsets[N_INPUT_1_1] = {
12., 0.5, 34., 10., 0.5, 33., 8.5, 0., 32., 7., 0.5,
29., 5., 0.5, 24., 3., 0., 15., 0., 0., 0., 0.,
0., 0.};

}
#endif
4 changes: 2 additions & 2 deletions AXOL1TL_v3/GTADModel_emulator_v3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class GTADModel_emulator_v3 : public hls4mlEmulator::Model {
{
for (int i = 0; i < N_INPUT_1_1; i++)
{
unscaled_t tmp0 = unscaled[i] - ad_offsets[i];
input_t tmp1 = tmp0 >> ad_shift[i];
unscaled_t tmp0 = unscaled[i] - hls4ml_axol1tl_v3::ad_offsets[i];
input_t tmp1 = tmp0 >> hls4ml_axol1tl_v3::ad_shift[i];
scaled[i] = tmp1;
}
}
Expand Down

0 comments on commit bc64def

Please sign in to comment.