Closed Dwedit closed 2 days ago
Hi @Dwedit , thanks for pointing this out. Errors indeed sound undesirable. I like your third idea, providing a Native = uint16_t if f16 is unavailable and HWY_IDE. Would you like to send a pull request implementing that?
In
detect_compiler_arch.h
, line 22:HWY_IDE
is defined when MSVC's intellisense is running. But MSVC's intellisense is not just for gathering the names of identifiers, it also populates an Error List that shows code which contains errors, even though these errors do not apply when actually building the project.One such error is "identifier 'Native' is undefined".
"Native" is defined in
base.h
, line 1075:It is only defined when
HWY_HAVE_SCALAR_F16_TYPE
is set, and eitherHWY_RVV_HAVE_F16_VEC
orHWY_SSE2_HAVE_F16_TYPE
are set. Otherwise it is undefined.But then "Native" is used without being defined when
HWY_IDE
is set.One such place is in
base.h
, line 1129:This puts an error into the Error List. But it still will compile correctly because
HWY_IDE
is not defined when building the project for real.Having phantom errors appearing in the Error List is confusing for a programmer, especially since those errors do not affect whether a project builds successfully. There are several possible ways to resolve the errors out of the error list:
HWY_IDE
is defined and the 16-bit floating point types are unavailable.