Blender V5.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#pragma once
6
7#ifndef __KERNEL_GPU__
8
9/* x86
10 *
11 * Compile a regular kernel. */
12
13# if defined(i386) || defined(_M_IX86)
14
15/* x86-64
16 *
17 * Compile a regular (includes SSE4.2) and AVX2 kernel. */
18
19# elif defined(__x86_64__) || defined(_M_X64)
20
21/* SSE4.2 is our minimum requirement for x86-64 CPUs, so auto enable */
22# define __KERNEL_SSE__
23# define __KERNEL_SSE2__
24# define __KERNEL_SSE3__
25# define __KERNEL_SSE42__
26/* no SSE4.2 kernel on x86-64, part of regular kernel */
27# ifdef WITH_KERNEL_AVX2
28# define WITH_CYCLES_OPTIMIZED_KERNEL_AVX2
29# endif
30
31/* Arm Neon
32 *
33 * Compile a SSE4 kernel emulated with Neon. Most code is shared with
34 * SSE, some specializations for performance and compatibility are made
35 * made testing for __KERNEL_NEON__. */
36
37# elif (defined(__ARM_NEON) || defined(_M_ARM64)) && defined(WITH_SSE2NEON)
38
39# define __KERNEL_NEON__
40# define __KERNEL_SSE__
41# define __KERNEL_SSE2__
42# define __KERNEL_SSE3__
43# define __KERNEL_SSE42__
44
45# endif
46
47#endif