Blender  V2.93
filter.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2017 Blender Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /* CPU kernel entry points */
18 
19 /* On x86-64, we can assume SSE2, so avoid the extra kernel and compile this
20  * one with SSE2 intrinsics.
21  */
22 #if defined(__x86_64__) || defined(_M_X64)
23 # define __KERNEL_SSE2__
24 #endif
25 
26 /* When building kernel for native machine detect kernel features from the flags
27  * set by compiler.
28  */
29 #ifdef WITH_KERNEL_NATIVE
30 # ifdef __SSE2__
31 # ifndef __KERNEL_SSE2__
32 # define __KERNEL_SSE2__
33 # endif
34 # endif
35 # ifdef __SSE3__
36 # define __KERNEL_SSE3__
37 # endif
38 # ifdef __SSSE3__
39 # define __KERNEL_SSSE3__
40 # endif
41 # ifdef __SSE4_1__
42 # define __KERNEL_SSE41__
43 # endif
44 # ifdef __AVX__
45 # define __KERNEL_SSE__
46 # define __KERNEL_AVX__
47 # endif
48 # ifdef __AVX2__
49 # define __KERNEL_SSE__
50 # define __KERNEL_AVX2__
51 # endif
52 #endif
53 
54 /* quiet unused define warnings */
55 #if defined(__KERNEL_SSE2__)
56 /* do nothing */
57 #endif
58 
59 #include "kernel/filter/filter.h"
60 #define KERNEL_ARCH cpu