What you can do as suggested by @usr1234567 is to compile a short code that includes _Float16
.
Here's a minimal working code :
cmake_minimum_required(VERSION 3.12)
project(MyProject C)
include(CheckSourceCompiles)
check_source_compiles(C "
#define __STDC_WANT_IEC_60559_TYPES_EXT__
#include <float.h>
int main() {
_Float16 x = 1.0f16;
return 0;
}
" HAVE_FLOAT16)
if(HAVE_FLOAT16)
message(STATUS "_Float16 is supported by the compiler.")
else()
message(WARNING "_Float16 is not supported by the compiler.")
endif()
I've found __STDC_WANT_IEC_60559_TYPES_EXT__
here : https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html