glow: Glow doesn't compile anymore due to FP16

I’m having issues compiling Glow currently. I get:

fp16.h:155:33: error: unable to find numeric literal operator 'operator""f'
  const float exp_scale = 0x1.0p-112f;
                                 ^~~~
fp16.h:155:33: note: use -fext-numeric-literals to enable more built-in suffixes

If I add -fext-numeric-literals for g++, I get later an error with clang (this option is not supported by Clang)

    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fext-numeric-literals")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fext-numeric-literals")

Error:

clang-6.0: error: unknown argument: '-fext-numeric-literals'

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 24 (21 by maintainers)

Most upvoted comments

@qcolombet I tried with the commit from @Maratyszcza , and it compiled correctly.

Hi @Maratyszcza,

Thanks for pushing a fix. Out of curiosity, do you see a need for the complicated macros definition? Put differently, when using the fp32_from_bits isn’t the compiler smart enough to emit the desired constant?

Added a work-around in Maratyszcza/FP16@5e2bd58cc5bfa0738fae08e388eec0ecfba041c4 Checked that the master of FP16 builds fine for -std=c++11 with the most recent gcc.

For the record, our CI use g++ (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4.