/* Copyright 2017 The TensorFlow Authors. 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 TENSORFLOW_LITE_KERNELS_INTERNAL_COMPATIBILITY_H_ #define TENSORFLOW_LITE_KERNELS_INTERNAL_COMPATIBILITY_H_ #include <cstdint> #include "tensorflow/lite/kernels/op_macros.h" #ifndef TFLITE_DCHECK #define TFLITE_DCHECK(condition) … #endif #ifndef TFLITE_DCHECK_EQ #define TFLITE_DCHECK_EQ(x, y) … #endif #ifndef TFLITE_DCHECK_NE #define TFLITE_DCHECK_NE(x, y) … #endif #ifndef TFLITE_DCHECK_GE #define TFLITE_DCHECK_GE(x, y) … #endif #ifndef TFLITE_DCHECK_GT #define TFLITE_DCHECK_GT(x, y) … #endif #ifndef TFLITE_DCHECK_LE #define TFLITE_DCHECK_LE(x, y) … #endif #ifndef TFLITE_DCHECK_LT #define TFLITE_DCHECK_LT(x, y) … #endif // TODO(ahentz): Clean up: We should stick to the DCHECK versions. #ifndef TFLITE_CHECK #define TFLITE_CHECK(condition) … #endif #ifndef TFLITE_CHECK_EQ #define TFLITE_CHECK_EQ(x, y) … #endif #ifndef TFLITE_CHECK_NE #define TFLITE_CHECK_NE(x, y) … #endif #ifndef TFLITE_CHECK_GE #define TFLITE_CHECK_GE(x, y) … #endif #ifndef TFLITE_CHECK_GT #define TFLITE_CHECK_GT(x, y) … #endif #ifndef TFLITE_CHECK_LE #define TFLITE_CHECK_LE(x, y) … #endif #ifndef TFLITE_CHECK_LT #define TFLITE_CHECK_LT(x, y) … #endif #ifndef TF_LITE_STATIC_MEMORY // TODO(b/162019032): Consider removing these type-aliases. int8; uint8; int16; uint16; int32; uint32; #endif // !defined(TF_LITE_STATIC_MEMORY) // Allow for cross-compiler usage of function signatures - currently used for // specifying named RUY profiler regions in templated methods. #if defined(_MSC_VER) #define TFLITE_PRETTY_FUNCTION … #elif defined(__GNUC__) #define TFLITE_PRETTY_FUNCTION … #else #define TFLITE_PRETTY_FUNCTION … #endif // TFLITE_DEPRECATED() // // Duplicated from absl/base/macros.h to avoid pulling in that library. // Marks a deprecated class, struct, enum, function, method and variable // declarations. The macro argument is used as a custom diagnostic message (e.g. // suggestion of a better alternative). // // Example: // // class TFLITE_DEPRECATED("Use Bar instead") Foo {...}; // TFLITE_DEPRECATED("Use Baz instead") void Bar() {...} // // Every usage of a deprecated entity will trigger a warning when compiled with // clang's `-Wdeprecated-declarations` option. This option is turned off by // default, but the warnings will be reported by clang-tidy. #if defined(__clang__) && __cplusplus >= 201103L #define TFLITE_DEPRECATED(message) … #endif #ifndef TFLITE_DEPRECATED #define TFLITE_DEPRECATED … #endif #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_COMPATIBILITY_H_