12#include "device/cpu/kernel.h"
26 const int max_num_inputs,
27 const int num_channels,
31 bool first_device =
true;
36 LOG_DEBUG <<
"Multi-devices are not yet fully implemented, will evaluate shader on a "
50 input.alloc(max_num_inputs);
51 int const num_points = fill_input(
input);
52 if (num_points == 0) {
56 input.copy_to_device();
57 output.alloc(num_points * num_channels);
92 float *output_data =
output.data();
96 local_arena.execute([&]() {
104 const int thread_index = tbb::this_task_arena::current_thread_index();
151 queue->init_execution();
155 const int32_t chunk_size = 65536;
166 queue->enqueue(kernel, d_work_size, args);
167 queue->synchronize();
ShaderEvalFunction shader_eval_background
ShaderEvalFunction shader_eval_volume_density
ShaderEvalFunction shader_eval_displace
ShaderEvalFunction shader_eval_curve_shadow_transparency
static const CPUKernels & get_cpu_kernels()
virtual unique_ptr< DeviceQueue > gpu_queue_create()
virtual void get_cpu_kernel_thread_globals(vector< ThreadKernelGlobalsCPU > &)
ShaderEval(Device *device, Progress &progress)
bool eval_cpu(Device *device, const ShaderEvalType type, device_vector< KernelShaderEvalInput > &input, device_vector< float > &output, const int64_t work_size)
bool eval(const ShaderEvalType type, const int max_num_inputs, const int num_channels, const std::function< int(device_vector< KernelShaderEvalInput > &)> &fill_input, const std::function< void(device_vector< float > &)> &read_output)
bool eval_gpu(Device *device, const ShaderEvalType type, device_vector< KernelShaderEvalInput > &input, device_vector< float > &output, const int64_t work_size)
#define CCL_NAMESPACE_END
#define assert(assertion)
ccl_gpu_kernel_postfix const ccl_global int ccl_global float const int work_size
@ DEVICE_KERNEL_SHADER_EVAL_DISPLACE
@ DEVICE_KERNEL_SHADER_EVAL_VOLUME_DENSITY
@ DEVICE_KERNEL_SHADER_EVAL_BACKGROUND
@ DEVICE_KERNEL_SHADER_EVAL_CURVE_SHADOW_TRANSPARENCY
@ SHADER_EVAL_VOLUME_DENSITY
@ SHADER_EVAL_CURVE_SHADOW_TRANSPARENCY