Skip to content

Commit

Permalink
Only force auto-vectorization for GCC >= 5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jmvalin committed Nov 27, 2023
1 parent 7cc30ec commit ee1bb69
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dnn/nnet_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@

/* Force vectorization on for DNN code because some of the loops rely on
compiler vectorization rather than explicitly using intrinsics. */
#ifdef __GNUC__
#if OPUS_GNUC_PREREQ(5,1)
#define GCC_POP_OPTIONS
#pragma GCC push_options
#pragma GCC optimize("tree-vectorize")
#endif
Expand Down Expand Up @@ -223,7 +224,7 @@ void RTCD_SUF(compute_conv2d_)(const Conv2dLayer *conv, float *out, float *mem,
}
}

#ifdef __GNUC__
#ifdef GCC_POP_OPTIONS
#pragma GCC pop_options
#endif

Expand Down

0 comments on commit ee1bb69

Please sign in to comment.