Motive Animation System
An open source project by FPL.
 All Classes Functions Variables Typedefs Friends Pages
optimizations.h
1 // Copyright 2015 Google Inc. All rights reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef MOTIVE_UTIL_OPTIMIZATIONS_H_
16 #define MOTIVE_UTIL_OPTIMIZATIONS_H_
17 
18 namespace motive {
19 
20 enum ProcessorOptimization {
21  kNoOptimizations,
22  kNeonOptimizations, /// NEON is a SIMD instruction set for ARM processors
23  kSse3Optimizations, /// SSE is a SIMD instruction set for x86 processors
24  kSsse3Optimizations /// SSSE3 is an extension of SSE3
25 };
26 
27 /// Look at the capabilities of the CPU and return the most performant set of
28 /// processor optimizations. For example, on Android, return kNeonOptimizations
29 /// if the CPU supports the NEON instruction set. On x86 (once we have x86
30 /// optimizations), return kSse2Optimizations if it's supported, or if it's not,
31 /// return kSse2Optimizations if it's supported. If none of the processors are
32 /// supported, return kNoOptimizations.
33 ProcessorOptimization BestProcessorOptimization();
34 
35 } // namespace motive
36 
37 #endif // MOTIVE_UTIL_OPTIMIZATIONS_H_