8#define __KERNEL_ONEAPI__
9#define __KERNEL_64_BIT__
12# define __KERNEL_GPU_RAYTRACING__
15#define CCL_NAMESPACE_BEGIN
16#define CCL_NAMESPACE_END
21#ifndef __NODES_MAX_GROUP__
22# define __NODES_MAX_GROUP__ NODE_GROUP_LEVEL_MAX
24#ifndef __NODES_FEATURES__
25# define __NODES_FEATURES__ NODE_FEATURE_ALL
36#define ccl_device inline
37#define ccl_device_extern extern "C"
39#define ccl_always_inline __attribute__((always_inline))
40#define ccl_device_inline __attribute__((always_inline))
41#define ccl_noinline __attribute__((noinline))
42#define ccl_inline_constant const constexpr
43#define ccl_device_constant static constexpr
44#define ccl_static_constexpr static constexpr
45#define ccl_device_forceinline __attribute__((always_inline))
46#define ccl_device_noinline __attribute__((noinline))
47#define ccl_device_noinline_cpu ccl_device
48#define ccl_device_inline_method ccl_device
49#define ccl_device_template_spec template<> ccl_device_inline
50#define ccl_restrict __restrict__
51#define ccl_optional_struct_init
53#define ccl_ray_data ccl_private
55#define ATTR_FALLTHROUGH __attribute__((fallthrough))
56#define ccl_constant const
57#define ccl_try_align(...) __attribute__((aligned(__VA_ARGS__)))
58#define ccl_align(n) __attribute__((aligned(n)))
59#define kernel_assert(cond)
61#define ccl_attr_maybe_unused [[maybe_unused]]
66#define ccl_gpu_kernel(block_num_threads, thread_num_registers)
67#define ccl_gpu_kernel_threads(block_num_threads)
69# define __ccl_gpu_kernel_signature(name, ...) \
70void oneapi_kernel_##name(KernelGlobalsGPU *ccl_restrict kg, \
71 size_t kernel_global_size, \
72 size_t kernel_local_size, \
77 sycl::nd_range<1>(kernel_global_size, kernel_local_size), \
78 [=](sycl::nd_item<1> item) {
80# define ccl_gpu_kernel_signature __ccl_gpu_kernel_signature
82# define ccl_gpu_kernel_postfix \
86#define ccl_gpu_kernel_call(x) ((ONEAPIKernelContext*)kg)->x
87#define ccl_gpu_kernel_within_bounds(i, n) ((i) < (n))
89#define ccl_gpu_kernel_lambda(func, ...) \
92 KernelLambda(const ONEAPIKernelContext *_kg) : kg(_kg) {} \
93 ccl_private const ONEAPIKernelContext *kg; \
95 int operator()(const int state) const { return (func); } \
96 } ccl_gpu_kernel_lambda_pass((ONEAPIKernelContext *)kg)
100# define ccl_gpu_thread_idx_x (sycl::ext::oneapi::this_work_item::get_nd_item<1>().get_local_id(0))
101# define ccl_gpu_block_dim_x (sycl::ext::oneapi::this_work_item::get_nd_item<1>().get_local_range(0))
102# define ccl_gpu_block_idx_x (sycl::ext::oneapi::this_work_item::get_nd_item<1>().get_group(0))
103# define ccl_gpu_grid_dim_x (sycl::ext::oneapi::this_work_item::get_nd_item<1>().get_group_range(0))
104# define ccl_gpu_warp_size (sycl::ext::oneapi::this_work_item::get_sub_group().get_local_range()[0])
105# define ccl_gpu_thread_mask(thread_warp) uint(0xFFFFFFFF >> (ccl_gpu_warp_size - thread_warp))
107# define ccl_gpu_global_id_x() (sycl::ext::oneapi::this_work_item::get_nd_item<1>().get_global_id(0))
108# define ccl_gpu_global_size_x() (sycl::ext::oneapi::this_work_item::get_nd_item<1>().get_global_range(0))
111# define ccl_gpu_syncthreads() sycl::ext::oneapi::this_work_item::get_nd_item<1>().barrier()
112# define ccl_gpu_local_syncthreads() sycl::ext::oneapi::this_work_item::get_nd_item<1>().barrier(sycl::access::fence_space::local_space)
118# define ccl_gpu_ballot(predicate) 0; static_assert(false, "Use sycl::inclusive_scan_over_group on oneAPI device instead of ccl_gpu_ballot")
121#if defined(__SYCL_DEVICE_ONLY__)
122# define CCL_ONEAPI_CONSTANT __attribute__((opencl_constant))
124# define CCL_ONEAPI_CONSTANT
127#define sycl_printf(format, ...) { \
128 static const CCL_ONEAPI_CONSTANT char fmt[] = format; \
129 sycl::ext::oneapi::experimental::printf(fmt, __VA_ARGS__ ); \
132#define sycl_printf_(format) { \
133 static const CCL_ONEAPI_CONSTANT char fmt[] = format; \
134 sycl::ext::oneapi::experimental::printf(fmt); \
146using uchar =
unsigned char;
152 return sycl::bit_cast<float>(
x);
156 return sycl::bit_cast<unsigned int>(
x);
160 return sycl::bit_cast<float>(
x);
164 return sycl::bit_cast<int>(
x);
167#define fabsf(x) sycl::fabs((x))
168#define copysignf(x, y) sycl::copysign((x), (y))
169#define asinf(x) sycl::asin((x))
170#define acosf(x) sycl::acos((x))
171#define atanf(x) sycl::atan((x))
172#define floorf(x) sycl::floor((x))
173#define ceilf(x) sycl::ceil((x))
174#define roundf(x) sycl::round((x))
175#define sinhf(x) sycl::sinh((x))
176#define coshf(x) sycl::cosh((x))
177#define tanhf(x) sycl::tanh((x))
178#define hypotf(x, y) sycl::hypot((x), (y))
179#define atan2f(x, y) sycl::atan2((x), (y))
180#define fmaxf(x, y) sycl::fmax((x), (y))
181#define fminf(x, y) sycl::fmin((x), (y))
182#define fmodf(x, y) sycl::fmod((x), (y))
183#define lgammaf(x) sycl::lgamma((x))
184#define ldexpf(x, y) sycl::ldexp((x), (y))
186#define cosf(x) sycl::native::cos(((float)(x)))
187#define sinf(x) sycl::native::sin(((float)(x)))
188#define powf(x, y) sycl::native::powr(((float)(x)), ((float)(y)))
189#define tanf(x) sycl::native::tan(((float)(x)))
190#define logf(x) sycl::native::log(((float)(x)))
191#define expf(x) sycl::native::exp(((float)(x)))
192#define sqrtf(x) sycl::native::sqrt(((float)(x)))
194#define __forceinline __attribute__((always_inline))
201 sizeof(sycl::ext::oneapi::experimental::sampled_image_handle::raw_image_handle_type) ==
215 static_assert(
false);
223 sycl::ext::oneapi::experimental::sampled_image_handle
image(
224 (sycl::ext::oneapi::experimental::sampled_image_handle::raw_image_handle_type)texobj);
225 return sycl::ext::oneapi::experimental::sample_image<float>(
image, sycl::float2{
x,
y});
232 sycl::ext::oneapi::experimental::sampled_image_handle
image(
233 (sycl::ext::oneapi::experimental::sampled_image_handle::raw_image_handle_type)texobj);
234 return sycl::ext::oneapi::experimental::sample_image<float4, sycl::vec<float, 4>>(
249 static_assert(
false);
257 sycl::ext::oneapi::experimental::sampled_image_handle
image(
258 (sycl::ext::oneapi::experimental::sampled_image_handle::raw_image_handle_type)texobj);
259 return sycl::ext::oneapi::experimental::sample_image<float>(
image, sycl::float3{
x,
y,
z});
266 sycl::ext::oneapi::experimental::sampled_image_handle
image(
267 (sycl::ext::oneapi::experimental::sampled_image_handle::raw_image_handle_type)texobj);
268 return sycl::ext::oneapi::experimental::sample_image<float4, sycl::vec<float, 4>>(
unsigned long long int uint64_t
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
#define ccl_device_forceinline
CUtexObject ccl_gpu_image_object_2D
ccl_device_forceinline T ccl_gpu_image_object_read_2D(const ccl_gpu_image_object_2D texobj, const float x, const float y)
ccl_device_forceinline T ccl_gpu_image_object_read_3D(const ccl_gpu_image_object_3D texobj, const float x, const float y, const float z)
uint64_t ccl_gpu_image_object_3D
#define image(slot, qualifiers, format)