1

Is there a way to unroll a loop in GCC based on compile-time (e.g., template) parameter?

The following does not compile, unless I replace unroll(N) with a concrete integer like unroll(8)

template<int N>
void fun ()
{
    #pragma GCC unroll(N)
    for (...)
         // body
}
user2052436
  • 4,321
  • 1
  • 25
  • 46

0 Answers0