Blender V5.0
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_SSE42__
23/* no SSE4.2 kernel on x86-64, part of regular kernel */
24# ifdef WITH_KERNEL_AVX2
25# define WITH_CYCLES_OPTIMIZED_KERNEL_AVX2
26# endif
27
28/* Arm Neon
29 *
30 * Compile a SSE4 kernel emulated with Neon. Most code is shared with
31 * SSE, some specializations for performance and compatibility are made
32 * made testing for __KERNEL_NEON__. */
33
34# elif (defined(__ARM_NEON) || defined(_M_ARM64)) && defined(WITH_SSE2NEON)
35
36# define __KERNEL_NEON__
37# define __KERNEL_SSE__
38# define __KERNEL_SSE2__
39# define __KERNEL_SSE3__
40# define __KERNEL_SSE42__
41
42# endif
43
44#endif