message: Guard populating FP16 tensors with TFLITE_ENABLE_FP16_CPU_BENCHMARKS macro in benchmarks, to avoid missing __gnu_f2h_ieee symbol error in default builds.
diff: @@ -427,6 +427,8 @@ TfLiteStatus BenchmarkTfLiteModel::PrepareInputData() {
  return static_cast<float>(rand()) / RAND_MAX - 0.5f;
  });
  } else if (t->type == kTfLiteFloat16) {
  +// TODO(b/138843274): Remove this preprocessor guard when bug is fixed.
  +#if TFLITE_ENABLE_FP16_CPU_BENCHMARKS
  #if __GNUC__ && \
  (__clang__ || __ARM_FP16_FORMAT_IEEE || __ARM_FP16_FORMAT_ALTERNATIVE)
  // __fp16 is available on Clang or when __ARM_FP16_FORMAT_* is defined.
  @@ -441,6 +443,14 @@ TfLiteStatus BenchmarkTfLiteModel::PrepareInputData() {
  TFLITE_LOG(FATAL) << "Don't know how to populate tensor " << t->name
  << " of type FLOAT16 on this platform.";
  #endif
  +#else
  + // You need to build with -DTFLITE_ENABLE_FP16_CPU_BENCHMARKS=1 using a
  + // compiler that supports __fp16 type. Note: when using Clang and *not*
  + // linking with compiler-rt, a defintion of __gnu_h2f_ieee and
  + // __gnu_f2h_ieee must be supplied.
  + TFLITE_LOG(FATAL) << "Populating the tensor " << t->name
  + << " of type FLOAT16 is disabled.";
  +#endif // TFLITE_ENABLE_FP16_CPU_BENCHMARKS
  } else if (t->type == kTfLiteInt64) {
  int low = has_value_range ? low_range : 0;
  int high = has_value_range ? high_range : 99;
  