Blender  V2.93
kernel_profiling.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2018 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_PROFILING_H__
18 #define __KERNEL_PROFILING_H__
19 
20 #ifdef __KERNEL_CPU__
21 # include "util/util_profiling.h"
22 #endif
23 
25 
26 #ifdef __KERNEL_CPU__
27 # define PROFILING_INIT(kg, event) ProfilingHelper profiling_helper(&kg->profiler, event)
28 # define PROFILING_EVENT(event) profiling_helper.set_event(event)
29 # define PROFILING_SHADER(shader) \
30  if ((shader) != SHADER_NONE) { \
31  profiling_helper.set_shader((shader)&SHADER_MASK); \
32  }
33 # define PROFILING_OBJECT(object) \
34  if ((object) != PRIM_NONE) { \
35  profiling_helper.set_object(object); \
36  }
37 #else
38 # define PROFILING_INIT(kg, event)
39 # define PROFILING_EVENT(event)
40 # define PROFILING_SHADER(shader)
41 # define PROFILING_OBJECT(object)
42 #endif /* __KERNEL_CPU__ */
43 
45 
46 #endif /* __KERNEL_PROFILING_H__ */
#define CCL_NAMESPACE_END