chromium/third_party/ruy/src/ruy/opt_set.h

/* Copyright 2019 Google LLC. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

#ifndef RUY_RUY_OPT_SET_H_
#define RUY_RUY_OPT_SET_H_

// RUY_OPT_SET is a compile-time API that Ruy provides for enabling/disabling
// certain optimizations. It should be used by defining that macro on the
// compiler command line.
//
// Each bit in RUY_OPT_SET controls a particular optimization done in Ruy.
#define RUY_OPT_BIT_INTRINSICS
#define RUY_OPT_BIT_ASM
#define RUY_OPT_BIT_TUNING
#define RUY_OPT_BIT_FAT_KERNEL
// 0x10 used to be RUY_OPT_BIT_NATIVE_ROUNDING
#define RUY_OPT_BIT_AVOID_ALIASING
#define RUY_OPT_BIT_MAX_STREAMING
#define RUY_OPT_BIT_PACK_AHEAD
#define RUY_OPT_BIT_PREFETCH_LOAD
#define RUY_OPT_BIT_PREFETCH_STORE
#define RUY_OPT_BIT_FRACTAL_Z
#define RUY_OPT_BIT_FRACTAL_U
#define RUY_OPT_BIT_FRACTAL_HILBERT

#if !defined(RUY_OPT_SET)
#ifdef RUY_OPTIMIZE_FOR_MATMUL_BENCHMARK
// Load prefetching is detrimental in matrix multiplication benchmarks.
// Store prefetching is not.
#define RUY_OPT_SET
#else
// Default to all optimizations.
#define RUY_OPT_SET
#endif
#endif

#define RUY_OPT(X)

#endif  // RUY_RUY_OPT_SET_H_