35#ifdef __PATH_GUIDING__
49#define KERNEL_STRUCT_BEGIN(name) struct {
50#define KERNEL_STRUCT_BEGIN_PACKED(parent_struct, feature) struct {
51#define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature) type name;
52#define KERNEL_STRUCT_MEMBER_PACKED KERNEL_STRUCT_MEMBER
53#define KERNEL_STRUCT_ARRAY_MEMBER KERNEL_STRUCT_MEMBER
54#define KERNEL_STRUCT_END(name) \
57#define KERNEL_STRUCT_END_ARRAY(name, cpu_size, gpu_size) \
60#define KERNEL_STRUCT_VOLUME_STACK_SIZE MAX_VOLUME_STACK_SIZE
62#undef KERNEL_STRUCT_BEGIN
63#undef KERNEL_STRUCT_BEGIN_PACKED
64#undef KERNEL_STRUCT_MEMBER
65#undef KERNEL_STRUCT_MEMBER_PACKED
66#undef KERNEL_STRUCT_ARRAY_MEMBER
67#undef KERNEL_STRUCT_END
68#undef KERNEL_STRUCT_END_ARRAY
72#define KERNEL_STRUCT_BEGIN(name) struct {
73#define KERNEL_STRUCT_BEGIN_PACKED(parent_struct, feature) struct {
74#define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature) type name;
75#define KERNEL_STRUCT_MEMBER_PACKED KERNEL_STRUCT_MEMBER
76#define KERNEL_STRUCT_ARRAY_MEMBER KERNEL_STRUCT_MEMBER
77#define KERNEL_STRUCT_END(name) \
80#define KERNEL_STRUCT_END_ARRAY(name, cpu_size, gpu_size) \
83#define KERNEL_STRUCT_VOLUME_STACK_SIZE MAX_VOLUME_STACK_SIZE
85#undef KERNEL_STRUCT_BEGIN
86#undef KERNEL_STRUCT_BEGIN_PACKED
87#undef KERNEL_STRUCT_MEMBER
88#undef KERNEL_STRUCT_MEMBER_PACKED
89#undef KERNEL_STRUCT_ARRAY_MEMBER
90#undef KERNEL_STRUCT_END
91#undef KERNEL_STRUCT_END_ARRAY
92#undef KERNEL_STRUCT_VOLUME_STACK_SIZE
106#if defined(__INTEGRATOR_GPU_PACKED_STATE__) && defined(__KERNEL_GPU__)
110# define KERNEL_STRUCT_BEGIN(name)
111# define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature) \
112 struct Wrapped_##parent_struct##_##name { \
115# define KERNEL_STRUCT_MEMBER_PACKED KERNEL_STRUCT_MEMBER
116# define KERNEL_STRUCT_BEGIN_PACKED(parent_struct, feature) \
117 KERNEL_STRUCT_BEGIN(parent_struct) \
118 KERNEL_STRUCT_MEMBER(parent_struct, packed_##parent_struct, packed, feature)
119# define KERNEL_STRUCT_ARRAY_MEMBER KERNEL_STRUCT_MEMBER
120# define KERNEL_STRUCT_END(name)
121# define KERNEL_STRUCT_END_ARRAY(name, cpu_size, gpu_size)
122# define KERNEL_STRUCT_VOLUME_STACK_SIZE MAX_VOLUME_STACK_SIZE
127# undef KERNEL_STRUCT_BEGIN
128# undef KERNEL_STRUCT_BEGIN_PACKED
129# undef KERNEL_STRUCT_MEMBER
130# undef KERNEL_STRUCT_MEMBER_PACKED
131# undef KERNEL_STRUCT_ARRAY_MEMBER
132# undef KERNEL_STRUCT_END
133# undef KERNEL_STRUCT_END_ARRAY
134# undef KERNEL_STRUCT_VOLUME_STACK_SIZE
142#define KERNEL_STRUCT_BEGIN(name) struct {
144#ifdef __INTEGRATOR_GPU_PACKED_STATE__
146# ifdef __KERNEL_GPU__
150# define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature) \
151 ccl_global Wrapped_##parent_struct##_##name *name; \
152 ccl_device_inline ccl_global Wrapped_##parent_struct##_##name *name##_fn() ccl_constant \
154 return (ccl_global Wrapped_##parent_struct##_##name *)name; \
156# define KERNEL_STRUCT_MEMBER_PACKED(parent_struct, type, name, feature) \
157 ccl_device_inline ccl_global packed_##parent_struct *name##_fn() ccl_constant \
159 return (ccl_global packed_##parent_struct *)packed; \
162# define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature) ccl_global type *name;
163# define KERNEL_STRUCT_MEMBER_PACKED(parent_struct, type, name, feature)
166# define KERNEL_STRUCT_BEGIN_PACKED(parent_struct, feature) \
167 KERNEL_STRUCT_BEGIN(parent_struct) \
168 KERNEL_STRUCT_MEMBER(parent_struct, packed_##parent_struct, packed, feature)
171# define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature) ccl_global type *name;
172# define KERNEL_STRUCT_MEMBER_PACKED KERNEL_STRUCT_MEMBER
173# define KERNEL_STRUCT_BEGIN_PACKED(parent_struct, feature) KERNEL_STRUCT_BEGIN(parent_struct)
175#define KERNEL_STRUCT_ARRAY_MEMBER KERNEL_STRUCT_MEMBER
176#define KERNEL_STRUCT_END(name) \
179#define KERNEL_STRUCT_END_ARRAY(name, cpu_size, gpu_size) \
182#define KERNEL_STRUCT_VOLUME_STACK_SIZE MAX_VOLUME_STACK_SIZE
188#undef KERNEL_STRUCT_BEGIN
189#undef KERNEL_STRUCT_BEGIN_PACKED
190#undef KERNEL_STRUCT_MEMBER
191#undef KERNEL_STRUCT_MEMBER_PACKED
192#undef KERNEL_STRUCT_ARRAY_MEMBER
193#undef KERNEL_STRUCT_END
194#undef KERNEL_STRUCT_END_ARRAY
195#undef KERNEL_STRUCT_VOLUME_STACK_SIZE
224#ifndef __KERNEL_GPU__
233# define INTEGRATOR_STATE_NULL nullptr
235# define INTEGRATOR_STATE(state, nested_struct, member) ((state)->nested_struct.member)
236# define INTEGRATOR_STATE_WRITE(state, nested_struct, member) ((state)->nested_struct.member)
238# define INTEGRATOR_STATE_ARRAY(state, nested_struct, array_index, member) \
239 ((state)->nested_struct[array_index].member)
240# define INTEGRATOR_STATE_ARRAY_WRITE(state, nested_struct, array_index, member) \
241 ((state)->nested_struct[array_index].member)
252# define INTEGRATOR_STATE_NULL -1
254# ifdef __INTEGRATOR_GPU_PACKED_STATE__
258# define INTEGRATOR_STATE(state, nested_struct, member) \
259 kernel_integrator_state.nested_struct.member##_fn()[state].member
260# define INTEGRATOR_STATE_ARRAY(state, nested_struct, array_index, member) \
261 kernel_integrator_state.nested_struct[array_index].member##_fn()[state].member
263# define INTEGRATOR_STATE(state, nested_struct, member) \
264 kernel_integrator_state.nested_struct.member[state]
265# define INTEGRATOR_STATE_ARRAY(state, nested_struct, array_index, member) \
266 kernel_integrator_state.nested_struct[array_index].member[state]
269# define INTEGRATOR_STATE_WRITE(state, nested_struct, member) \
270 INTEGRATOR_STATE(state, nested_struct, member)
271# define INTEGRATOR_STATE_ARRAY_WRITE(state, nested_struct, array_index, member) \
272 INTEGRATOR_STATE_ARRAY(state, nested_struct, array_index, member)
#define CCL_NAMESPACE_END
@ DEVICE_KERNEL_INTEGRATOR_NUM
const IntegratorShadowStateCPU *ccl_restrict ConstIntegratorShadowState
CCL_NAMESPACE_BEGIN struct IntegratorShadowStateCPU IntegratorShadowStateCPU
struct IntegratorQueueCounter IntegratorQueueCounter
struct IntegratorStateGPU IntegratorStateGPU
IntegratorStateCPU *ccl_restrict IntegratorState
const IntegratorStateCPU *ccl_restrict ConstIntegratorState
IntegratorShadowStateCPU *ccl_restrict IntegratorShadowState
struct IntegratorStateCPU IntegratorStateCPU
int num_queued[DEVICE_KERNEL_INTEGRATOR_NUM]
IntegratorShadowStateCPU shadow
IntegratorShadowStateCPU ao
ccl_global IntegratorQueueCounter * queue_counter
ccl_global int * next_shadow_path_index
ccl_global int * next_main_path_index
ccl_global int * sort_partition_key_offsets
ccl_global int * sort_key_counter[DEVICE_KERNEL_INTEGRATOR_NUM]
uint sort_partition_divisor