Blender V4.3
optimization.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5#ifndef __UTIL_OPTIMIZATION_H__
6#define __UTIL_OPTIMIZATION_H__
7
8#ifndef __KERNEL_GPU__
9
10/* x86
11 *
12 * Compile a regular and SSE42 kernel. */
13
14# if defined(i386) || defined(_M_IX86)
15
16/* We require minimum SSE4.2 support on x86, so auto enable. */
17# define __KERNEL_SSE42__
18# ifdef WITH_KERNEL_SSE42
19# define WITH_CYCLES_OPTIMIZED_KERNEL_SSE42
20# endif
21
22/* x86-64
23 *
24 * Compile a regular (includes SSE4.2) and AVX2 kernel. */
25
26# elif defined(__x86_64__) || defined(_M_X64)
27
28/* SSE4.2 is our minimum requirement for x86-64 CPUs, so auto enable */
29# define __KERNEL_SSE42__
30/* no SSE4.2 kernel on x86-64, part of regular kernel */
31# ifdef WITH_KERNEL_AVX2
32# define WITH_CYCLES_OPTIMIZED_KERNEL_AVX2
33# endif
34
35/* Arm Neon
36 *
37 * Compile a SSE4 kernel emulated with Neon. Most code is shared with
38 * SSE, some specializations for performance and compatibility are made
39 * made testing for __KERNEL_NEON__. */
40
41# elif (defined(__ARM_NEON) || defined(_M_ARM64)) && defined(WITH_SSE2NEON)
42
43# define __KERNEL_NEON__
44# define __KERNEL_SSE__
45# define __KERNEL_SSE2__
46# define __KERNEL_SSE3__
47# define __KERNEL_SSE42__
48
49# endif
50
51#endif
52
53#endif /* __UTIL_OPTIMIZATION_H__ */