Daniel Konegen / MNIST_example

Dependencies:   mbed-os

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers neon_check.h Source File

neon_check.h

00001 /* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
00002 
00003 Licensed under the Apache License, Version 2.0 (the "License");
00004 you may not use this file except in compliance with the License.
00005 You may obtain a copy of the License at
00006 
00007     http://www.apache.org/licenses/LICENSE-2.0
00008 
00009 Unless required by applicable law or agreed to in writing, software
00010 distributed under the License is distributed on an "AS IS" BASIS,
00011 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00012 See the License for the specific language governing permissions and
00013 limitations under the License.
00014 ==============================================================================*/
00015 #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_OPTIMIZED_NEON_CHECK_H_
00016 #define TENSORFLOW_LITE_KERNELS_INTERNAL_OPTIMIZED_NEON_CHECK_H_
00017 
00018 #if defined(__ARM_NEON__) || defined(__ARM_NEON)
00019 #define USE_NEON
00020 #include <arm_neon.h>
00021 #endif
00022 
00023 #if defined __GNUC__ && defined __SSE4_1__ && !defined TF_LITE_DISABLE_X86_NEON
00024 #define USE_NEON
00025 #pragma GCC diagnostic push
00026 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
00027 #pragma GCC diagnostic ignored "-Wattributes"
00028 #pragma GCC diagnostic ignored "-Wnarrowing"
00029 #pragma GCC diagnostic ignored "-Wsequence-point"
00030 #include "NEON_2_SSE.h"
00031 #pragma GCC diagnostic pop
00032 #endif
00033 
00034 // NEON_OR_PORTABLE(SomeFunc, args) calls NeonSomeFunc(args) if USE_NEON is
00035 // defined, PortableSomeFunc(args) otherwise.
00036 #ifdef USE_NEON
00037 // Always use Neon code
00038 #define NEON_OR_PORTABLE(funcname, ...) Neon##funcname(__VA_ARGS__)
00039 
00040 #else
00041 // No NEON available: Use Portable code
00042 #define NEON_OR_PORTABLE(funcname, ...) Portable##funcname(__VA_ARGS__)
00043 
00044 #endif  // defined(USE_NEON)
00045 
00046 #endif  // TENSORFLOW_LITE_KERNELS_INTERNAL_OPTIMIZED_NEON_CHECK_H_