33#if defined(__PATH_GUIDING__)
47#define KERNEL_STRUCT_BEGIN(name) struct {
48#define KERNEL_STRUCT_BEGIN_PACKED(parent_struct, feature) struct {
49#define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature) type name;
50#define KERNEL_STRUCT_MEMBER_PACKED KERNEL_STRUCT_MEMBER
51#define KERNEL_STRUCT_ARRAY_MEMBER KERNEL_STRUCT_MEMBER
52#define KERNEL_STRUCT_END(name) \
55#define KERNEL_STRUCT_END_ARRAY(name, cpu_size, gpu_size) \
58#define KERNEL_STRUCT_VOLUME_STACK_SIZE MAX_VOLUME_STACK_SIZE
60#undef KERNEL_STRUCT_BEGIN
61#undef KERNEL_STRUCT_BEGIN_PACKED
62#undef KERNEL_STRUCT_MEMBER
63#undef KERNEL_STRUCT_MEMBER_PACKED
64#undef KERNEL_STRUCT_ARRAY_MEMBER
65#undef KERNEL_STRUCT_END
66#undef KERNEL_STRUCT_END_ARRAY
70#define KERNEL_STRUCT_BEGIN(name) struct {
71#define KERNEL_STRUCT_BEGIN_PACKED(parent_struct, feature) struct {
72#define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature) type name;
73#define KERNEL_STRUCT_MEMBER_PACKED KERNEL_STRUCT_MEMBER
74#define KERNEL_STRUCT_ARRAY_MEMBER KERNEL_STRUCT_MEMBER
75#define KERNEL_STRUCT_END(name) \
78#define KERNEL_STRUCT_END_ARRAY(name, cpu_size, gpu_size) \
81#define KERNEL_STRUCT_VOLUME_STACK_SIZE MAX_VOLUME_STACK_SIZE
83#undef KERNEL_STRUCT_BEGIN
84#undef KERNEL_STRUCT_BEGIN_PACKED
85#undef KERNEL_STRUCT_MEMBER
86#undef KERNEL_STRUCT_MEMBER_PACKED
87#undef KERNEL_STRUCT_ARRAY_MEMBER
88#undef KERNEL_STRUCT_END
89#undef KERNEL_STRUCT_END_ARRAY
90#undef KERNEL_STRUCT_VOLUME_STACK_SIZE
105#if defined(__INTEGRATOR_GPU_PACKED_STATE__) && defined(__KERNEL_GPU__)
109# define KERNEL_STRUCT_BEGIN(name)
110# define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature) \
111 struct Wrapped_##parent_struct##_##name { \
114# define KERNEL_STRUCT_MEMBER_PACKED KERNEL_STRUCT_MEMBER
115# define KERNEL_STRUCT_BEGIN_PACKED(parent_struct, feature) \
116 KERNEL_STRUCT_BEGIN(parent_struct) \
117 KERNEL_STRUCT_MEMBER(parent_struct, packed_##parent_struct, packed, feature)
118# define KERNEL_STRUCT_ARRAY_MEMBER KERNEL_STRUCT_MEMBER
119# define KERNEL_STRUCT_END(name)
120# define KERNEL_STRUCT_END_ARRAY(name, cpu_size, gpu_size)
121# define KERNEL_STRUCT_VOLUME_STACK_SIZE MAX_VOLUME_STACK_SIZE
126# undef KERNEL_STRUCT_BEGIN
127# undef KERNEL_STRUCT_BEGIN_PACKED
128# undef KERNEL_STRUCT_MEMBER
129# undef KERNEL_STRUCT_MEMBER_PACKED
130# undef KERNEL_STRUCT_ARRAY_MEMBER
131# undef KERNEL_STRUCT_END
132# undef KERNEL_STRUCT_END_ARRAY
133# undef KERNEL_STRUCT_VOLUME_STACK_SIZE
141#define KERNEL_STRUCT_BEGIN(name) struct {
143#ifdef __INTEGRATOR_GPU_PACKED_STATE__
145# ifdef __KERNEL_GPU__
149# define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature) \
150 ccl_global Wrapped_##parent_struct##_##name *name; \
151 ccl_device_inline ccl_global Wrapped_##parent_struct##_##name *name##_fn() ccl_constant \
153 return (ccl_global Wrapped_##parent_struct##_##name *)name; \
155# define KERNEL_STRUCT_MEMBER_PACKED(parent_struct, type, name, feature) \
156 ccl_device_inline ccl_global packed_##parent_struct *name##_fn() ccl_constant \
158 return (ccl_global packed_##parent_struct *)packed; \
161# define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature) ccl_global type *name;
162# define KERNEL_STRUCT_MEMBER_PACKED(parent_struct, type, name, feature)
165# define KERNEL_STRUCT_BEGIN_PACKED(parent_struct, feature) \
166 KERNEL_STRUCT_BEGIN(parent_struct) \
167 KERNEL_STRUCT_MEMBER(parent_struct, packed_##parent_struct, packed, feature)
170# define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature) ccl_global type *name;
171# define KERNEL_STRUCT_MEMBER_PACKED KERNEL_STRUCT_MEMBER
172# define KERNEL_STRUCT_BEGIN_PACKED(parent_struct, feature) KERNEL_STRUCT_BEGIN(parent_struct)
174#define KERNEL_STRUCT_ARRAY_MEMBER KERNEL_STRUCT_MEMBER
175#define KERNEL_STRUCT_END(name) \
178#define KERNEL_STRUCT_END_ARRAY(name, cpu_size, gpu_size) \
181#define KERNEL_STRUCT_VOLUME_STACK_SIZE MAX_VOLUME_STACK_SIZE
187#undef KERNEL_STRUCT_BEGIN
188#undef KERNEL_STRUCT_BEGIN_PACKED
189#undef KERNEL_STRUCT_MEMBER
190#undef KERNEL_STRUCT_MEMBER_PACKED
191#undef KERNEL_STRUCT_ARRAY_MEMBER
192#undef KERNEL_STRUCT_END
193#undef KERNEL_STRUCT_END_ARRAY
194#undef KERNEL_STRUCT_VOLUME_STACK_SIZE
223#ifndef __KERNEL_GPU__
234# define INTEGRATOR_STATE(state, nested_struct, member) ((state)->nested_struct.member)
235# define INTEGRATOR_STATE_WRITE(state, nested_struct, member) ((state)->nested_struct.member)
237# define INTEGRATOR_STATE_ARRAY(state, nested_struct, array_index, member) \
238 ((state)->nested_struct[array_index].member)
239# define INTEGRATOR_STATE_ARRAY_WRITE(state, nested_struct, array_index, member) \
240 ((state)->nested_struct[array_index].member)
264# ifdef __INTEGRATOR_GPU_PACKED_STATE__
268# define INTEGRATOR_STATE(state, nested_struct, member) \
269 kernel_integrator_state.nested_struct.member##_fn()[state].member
270# define INTEGRATOR_STATE_ARRAY(state, nested_struct, array_index, member) \
271 kernel_integrator_state.nested_struct[array_index].member##_fn()[state].member
273# define INTEGRATOR_STATE(state, nested_struct, member) \
274 kernel_integrator_state.nested_struct.member[state]
275# define INTEGRATOR_STATE_ARRAY(state, nested_struct, array_index, member) \
276 kernel_integrator_state.nested_struct[array_index].member[state]
279# define INTEGRATOR_STATE_WRITE(state, nested_struct, member) \
280 INTEGRATOR_STATE(state, nested_struct, member)
281# define INTEGRATOR_STATE_ARRAY_WRITE(state, nested_struct, array_index, member) \
282 INTEGRATOR_STATE_ARRAY(state, nested_struct, array_index, member)
#define ccl_device_inline_method
#define CCL_NAMESPACE_END
@ DEVICE_GPU_KERNEL_INTEGRATOR_NUM
IntegratorShadowStateCPU * IntegratorShadowState
IntegratorBakeState ConstIntegratorBakeState
const IntegratorShadowStateCPU * ConstIntegratorShadowState
IntegratorStateCPU * IntegratorState
const IntegratorStateCPU * ConstIntegratorState
int num_queued[DEVICE_GPU_KERNEL_INTEGRATOR_NUM]
IntegratorShadowStateCPU ao
ccl_global int * next_shadow_path_index
ccl_global int * next_main_path_index
ccl_global int * sort_partition_key_offsets
uint sort_partition_divisor
ccl_global int * sort_key_counter[DEVICE_GPU_KERNEL_INTEGRATOR_NUM]