diff --git a/tensorflow/lite/experimental/ruy/context.cc b/tensorflow/lite/experimental/ruy/context.cc index aea42cdf501..f85a5cc5fa7 100644 --- a/tensorflow/lite/experimental/ruy/context.cc +++ b/tensorflow/lite/experimental/ruy/context.cc @@ -40,6 +40,13 @@ Path Context::GetRuntimeEnabledPaths() { // Need to resolve now. Start by considering all paths enabled. runtime_enabled_paths_ = kAllPaths; + // This mechanism is intended to be used for testing and benchmarking. For + // example, one can set RUY_FORCE_DISABLE_PATHS to Path::kAvx512 in order to + // evaluate AVX2 performance on an AVX-512 machine. +#ifdef RUY_FORCE_DISABLE_PATHS + runtime_enabled_paths_ = runtime_enabled_paths_ & ~(RUY_FORCE_DISABLE_PATHS); +#endif + #if RUY_PLATFORM(ARM) // Now selectively disable paths that aren't supported on this machine. if ((runtime_enabled_paths_ & Path::kNeonDotprod) != Path::kNone) {