MCPcopy Create free account
hub / github.com/blender/cycles / enqueue

Method enqueue

src/device/oneapi/queue.cpp:71–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71bool OneapiDeviceQueue::enqueue(DeviceKernel kernel,
72 const int signed_kernel_work_size,
73 const DeviceKernelArguments &_args)
74{
75 if (oneapi_device_->have_error()) {
76 return false;
77 }
78
79 /* Update image info in case memory moved to host. */
80 if (oneapi_device_->load_image_info()) {
81 if (!synchronize()) {
82 return false;
83 }
84 }
85
86 void **args = const_cast<void **>(_args.values);
87
88 debug_enqueue_begin(kernel, signed_kernel_work_size);
89 assert(signed_kernel_work_size >= 0);
90 size_t kernel_global_size = (size_t)signed_kernel_work_size;
91 size_t kernel_local_size;
92
93 assert(kernel_context_);
94 kernel_context_->scene_max_shaders = oneapi_device_->scene_max_shaders();
95
96 oneapi_device_->get_adjusted_global_and_local_sizes(
97 kernel_context_->queue, kernel, kernel_global_size, kernel_local_size);
98
99 /* Call the oneAPI kernel DLL to launch the requested kernel. */
100 bool is_finished_ok = oneapi_device_->enqueue_kernel(
101 kernel_context_.get(), kernel, kernel_global_size, kernel_local_size, args);
102
103 if (is_finished_ok == false) {
104 oneapi_device_->set_error("oneAPI kernel \"" + std::string(device_kernel_as_string(kernel)) +
105 "\" execution error: got runtime exception \"" +
106 oneapi_device_->oneapi_error_message() + "\"");
107 }
108
109 debug_enqueue_end();
110
111 return is_finished_ok;
112}
113
114bool OneapiDeviceQueue::synchronize()
115{

Callers 1

Calls 8

device_kernel_as_stringFunction · 0.85
have_errorMethod · 0.80
scene_max_shadersMethod · 0.80
enqueue_kernelMethod · 0.80
oneapi_error_messageMethod · 0.80
load_image_infoMethod · 0.45
set_errorMethod · 0.45

Tested by

no test coverage detected