21 #ifndef __KERNEL_CUDA__
29 if (offset >= qsize) {
41 uint idx = offset + i + lid;
52 local_value[i + lid] = value;
53 local_index[i + lid] = i + lid;
58 # ifdef __KERNEL_OPENCL__
65 bool direction = ((i & (
length << 1)) != 0);
67 ushort ioff = local_index[i];
68 ushort joff = local_index[j];
69 uint iKey = local_value[ioff];
70 uint jKey = local_value[joff];
71 bool smaller = (jKey < iKey) || (jKey == iKey && j < i);
72 bool swap = smaller ^ (j < i) ^ direction;
74 local_index[i] = (
swap) ? joff : ioff;
75 local_index[j] = (
swap) ? ioff : joff;
84 uint idx = offset + i + lid;
85 uint lidx = local_index[i + lid];
87 uint ini = input + offset + lidx;
88 uint value = local_value[lidx];
SIMD_FORCE_INLINE btScalar length(const btQuaternion &q)
Return the length of a quaternion.
#define ccl_global_size(d)
ccl_device_inline uint ccl_local_id(uint d)
ccl_device_inline uint ccl_local_size(uint d)
#define CCL_NAMESPACE_END
CCL_NAMESPACE_BEGIN ccl_device void kernel_shader_sort(KernelGlobals *kg, ccl_local_param ShaderSortLocals *locals)
#define kernel_split_params
#define kernel_split_sd(sd, ray_index)
#define kernel_split_state
#define SHADER_SORT_BLOCK_SIZE
#define IS_STATE(ray_state, ray_index, state)
#define SHADER_SORT_LOCAL_SIZE
@ QUEUE_SHADER_SORTED_RAYS
@ QUEUE_ACTIVE_AND_REGENERATED_RAYS
static void add(GHash *messages, MemArena *memarena, const Message *msg)
#define CCL_LOCAL_MEM_FENCE
#define ccl_barrier(flags)