Cycles: Make all #include statements relative to cycles source directory
[blender.git] / intern / cycles / kernel / kernel.h
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 #ifndef __KERNEL_H__
18 #define __KERNEL_H__
19
20 /* CPU Kernel Interface */
21
22 #include "util/util_types.h"
23 #include "kernel/kernel_types.h"
24
25 CCL_NAMESPACE_BEGIN
26
27 #define KERNEL_NAME_JOIN(x, y, z) x ## _ ## y ## _ ## z
28 #define KERNEL_NAME_EVAL(arch, name)  KERNEL_NAME_JOIN(kernel, arch, name)
29 #define KERNEL_FUNCTION_FULL_NAME(name) KERNEL_NAME_EVAL(KERNEL_ARCH, name)
30
31 struct KernelGlobals;
32 struct KernelData;
33
34 KernelGlobals *kernel_globals_create();
35 void kernel_globals_free(KernelGlobals *kg);
36
37 void *kernel_osl_memory(KernelGlobals *kg);
38 bool kernel_osl_use(KernelGlobals *kg);
39
40 void kernel_const_copy(KernelGlobals *kg, const char *name, void *host, size_t size);
41 void kernel_tex_copy(KernelGlobals *kg,
42                      const char *name,
43                      device_ptr mem,
44                      size_t width,
45                      size_t height,
46                      size_t depth,
47                      InterpolationType interpolation=INTERPOLATION_LINEAR,
48                      ExtensionType extension = EXTENSION_REPEAT);
49
50 #define KERNEL_ARCH cpu
51 #include "kernel/kernels/cpu/kernel_cpu.h"
52
53 #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_SSE2
54 #  define KERNEL_ARCH cpu_sse2
55 #  include "kernel/kernels/cpu/kernel_cpu.h"
56 #endif  /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 */
57
58 #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_SSE3
59 #  define KERNEL_ARCH cpu_sse3
60 #  include "kernel/kernels/cpu/kernel_cpu.h"
61 #endif  /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 */
62
63 #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_SSE41
64 #  define KERNEL_ARCH cpu_sse41
65 #  include "kernel/kernels/cpu/kernel_cpu.h"
66 #endif  /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 */
67
68 #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_AVX
69 #  define KERNEL_ARCH cpu_avx
70 #  include "kernel/kernels/cpu/kernel_cpu.h"
71 #endif  /* WITH_CYCLES_OPTIMIZED_KERNEL_AVX */
72
73 #ifdef WITH_CYCLES_OPTIMIZED_KERNEL_AVX2
74 #  define KERNEL_ARCH cpu_avx2
75 #  include "kernel/kernels/cpu/kernel_cpu.h"
76 #endif  /* WITH_CYCLES_OPTIMIZED_KERNEL_AVX2 */
77
78 CCL_NAMESPACE_END
79
80 #endif /* __KERNEL_H__ */
81