Blender  V2.93
kernel_split.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2013 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 #define __SPLIT_KERNEL__
27 
28 /* When building kernel for native machine detect kernel features from the flags
29  * set by compiler.
30  */
31 #ifdef WITH_KERNEL_NATIVE
32 # ifdef __SSE2__
33 # ifndef __KERNEL_SSE2__
34 # define __KERNEL_SSE2__
35 # endif
36 # endif
37 # ifdef __SSE3__
38 # define __KERNEL_SSE3__
39 # endif
40 # ifdef __SSSE3__
41 # define __KERNEL_SSSE3__
42 # endif
43 # ifdef __SSE4_1__
44 # define __KERNEL_SSE41__
45 # endif
46 # ifdef __AVX__
47 # define __KERNEL_AVX__
48 # endif
49 # ifdef __AVX2__
50 # define __KERNEL_SSE__
51 # define __KERNEL_AVX2__
52 # endif
53 #endif
54 
55 /* quiet unused define warnings */
56 #if defined(__KERNEL_SSE2__)
57 /* do nothing */
58 #endif
59 
60 #include "kernel/kernel.h"
61 #define KERNEL_ARCH cpu