9# include <sycl/sycl.hpp>
15# ifdef WITH_EMBREE_GPU
19# if defined(WITH_OPENIMAGEDENOISE)
20# include <OpenImageDenoise/config.h>
21# if OIDN_VERSION >= 20300
31# if defined(WITH_EMBREE_GPU) && defined(EMBREE_SYCL_SUPPORT) && !defined(SYCL_LANGUAGE_VERSION)
34extern "C" RTCDevice rtcNewSYCLDevice(sycl::context context,
const char *config);
35extern "C" bool rtcIsSYCLDeviceSupported(
const sycl::device sycl_device);
36extern "C" void rtcSetDeviceSYCLDevice(RTCDevice device,
const sycl::device sycl_device);
41struct SyclDeviceEntry {
43 bool meets_driver_requirement;
46static std::vector<SyclDeviceEntry> available_sycl_devices(
47 bool *multiple_level_zero_platforms_detected);
48static int parse_driver_build_version(
const sycl::device &device);
50static void queue_error_cb(
const char *message,
void *user_ptr)
53 *
reinterpret_cast<std::string *
>(user_ptr) = message;
58 :
GPUDevice(info, stats, profiler, headless)
60# ifndef WITH_CYCLES_ONEAPI_SOFTWARE_TEXTURING
62 static_assert(
sizeof(texMemObject) ==
63 sizeof(sycl::ext::oneapi::experimental::sampled_image_handle));
64 static_assert(
sizeof(arrayMemObject) ==
65 sizeof(sycl::ext::oneapi::experimental::image_mem_handle));
68 need_image_info =
false;
71 oneapi_set_error_cb(queue_error_cb, &oneapi_error_string_);
73 bool multiple_level_zero_platforms_detected =
false;
75 bool is_finished_ok = create_queue(device_queue_,
77# ifdef WITH_EMBREE_GPU
78 use_hardware_raytracing ? (
void *)&embree_device :
nullptr,
82 &multiple_level_zero_platforms_detected);
92 if (multiple_level_zero_platforms_detected) {
93 use_intel_copy_optimization =
false;
96# ifdef SYCL_EXT_ONEAPI_COPY_OPTIMIZE
97 if (!use_intel_copy_optimization) {
98 LOG_TRACE <<
"oneAPI copy optimization extension may have issues on the detected "
99 "configuration, it will be disabled to avoid crashes.";
103 if (is_finished_ok ==
false) {
104 set_error(
"oneAPI queue initialization error: got runtime exception \"" +
105 oneapi_error_string_ +
"\"");
113# ifdef WITH_EMBREE_GPU
114 use_hardware_raytracing = use_hardware_raytracing && (embree_device !=
nullptr);
116 use_hardware_raytracing =
false;
119 if (use_hardware_raytracing) {
120 LOG_INFO <<
"oneAPI will use hardware ray tracing for intersection acceleration.";
123 size_t globals_segment_size;
124 is_finished_ok = kernel_globals_size(globals_segment_size);
125 if (is_finished_ok ==
false) {
126 set_error(
"oneAPI constant memory initialization got runtime exception \"" +
127 oneapi_error_string_ +
"\"");
130 LOG_TRACE <<
"Successfully created global/constant memory segment (kernel globals object)";
133 kg_memory_ = usm_aligned_alloc_host(device_queue_, globals_segment_size, 16);
134 usm_memset(device_queue_, kg_memory_, 0, globals_segment_size);
136 kg_memory_device_ = usm_alloc_device(device_queue_, globals_segment_size);
138 kg_memory_size_ = globals_segment_size;
140 max_memory_on_device_ = get_memcapacity();
144 const char *headroom_str = getenv(
"CYCLES_ONEAPI_MEMORY_HEADROOM");
145 if (headroom_str !=
nullptr) {
146 const long long override_headroom = (
float)atoll(headroom_str);
147 device_working_headroom = override_headroom;
148 device_image_headroom = override_headroom;
150 LOG_TRACE <<
"oneAPI memory headroom size: "
154OneapiDevice::~OneapiDevice()
156# ifdef WITH_EMBREE_GPU
158 rtcReleaseDevice(embree_device);
163 usm_free(device_queue_, kg_memory_);
164 usm_free(device_queue_, kg_memory_device_);
166 const_mem_map_.clear();
169 free_queue(device_queue_);
173bool OneapiDevice::check_peer_access(
Device * )
178bool OneapiDevice::can_use_hardware_raytracing_for_features(
179 const uint64_t requested_features)
const
183# if defined(RTC_VERSION) && RTC_VERSION < 40100
186 (void)requested_features;
193 return (use_hardware_raytracing &&
194 can_use_hardware_raytracing_for_features(requested_features)) ?
199# ifdef WITH_EMBREE_GPU
203 BVHEmbree *
const bvh_embree =
static_cast<BVHEmbree *
>(bvh);
205 bvh_embree->refit(progress);
208 bvh_embree->build(progress, &stats, embree_device,
true);
211# if RTC_VERSION >= 40302
213 all_embree_scenes.push_back(bvh_embree->scene);
217# if RTC_VERSION >= 40400
218 embree_traversable = rtcGetSceneTraversable(bvh_embree->scene);
220 embree_traversable = bvh_embree->scene;
222# if RTC_VERSION >= 40302
223 RTCError error_code = bvh_embree->offload_scenes_to_gpu(all_embree_scenes);
224 if (error_code != RTC_ERROR_NONE) {
226 string_printf(
"BVH failed to migrate to the GPU due to Embree library error (%s)",
227 bvh_embree->get_error_string(error_code)));
229 all_embree_scenes.clear();
239size_t OneapiDevice::get_free_mem()
const
241 size_t free_memory = 0;
244 const size_t resident_memory = stats.
mem_used - map_host_used;
245 if (resident_memory < max_memory_on_device_) {
246 free_memory = max_memory_on_device_ - resident_memory;
252 const sycl::device &device =
reinterpret_cast<sycl::queue *
>(device_queue_)->get_device();
253 if (device.has(sycl::aspect::ext_intel_free_memory)) {
254 free_memory =
min(device.get_info<sycl::ext::intel::info::device::free_memory>(), free_memory);
260bool OneapiDevice::load_kernels(
const uint64_t requested_features)
270 kernel_features |= requested_features;
272 bool is_finished_ok = oneapi_run_test_kernel(device_queue_);
273 if (is_finished_ok ==
false) {
274 set_error(
"oneAPI test kernel execution: got a runtime exception \"" + oneapi_error_string_ +
278 LOG_INFO <<
"Test kernel has been executed successfully for \"" << info.
description <<
"\"";
281 if (use_hardware_raytracing && !can_use_hardware_raytracing_for_features(requested_features)) {
283 <<
"Hardware ray tracing disabled, not supported yet by oneAPI for requested features.";
284 use_hardware_raytracing =
false;
287 is_finished_ok = oneapi_load_kernels(
288 device_queue_, (
const unsigned int)requested_features, use_hardware_raytracing);
289 if (is_finished_ok ==
false) {
290 set_error(
"oneAPI kernels loading: got a runtime exception \"" + oneapi_error_string_ +
"\"");
293 LOG_INFO <<
"Kernels loading (compilation) has been done for \"" << info.
description <<
"\"";
296 if (is_finished_ok) {
297 reserve_private_memory(requested_features);
298 is_finished_ok = !have_error();
301 return is_finished_ok;
304void OneapiDevice::reserve_private_memory(
const uint64_t kernel_features)
306 size_t free_before = get_free_mem();
321 queue->init_execution();
325 queue->enqueue(test_kernel, 1, args);
326 queue->synchronize();
329 size_t free_after = get_free_mem();
331 LOG_INFO <<
"For kernel execution were reserved "
336void OneapiDevice::get_device_memory_info(
size_t &total,
size_t &free)
338 free = get_free_mem();
339 total = max_memory_on_device_;
342bool OneapiDevice::alloc_device(
void *&device_pointer,
const size_t size)
344 bool allocation_success =
false;
345 device_pointer = usm_alloc_device(device_queue_,
size);
346 if (device_pointer !=
nullptr) {
347 allocation_success =
true;
350 if (!oneapi_zero_memory_on_device(device_queue_, device_pointer,
size)) {
351 set_error(
"oneAPI memory operation error: got runtime exception \"" + oneapi_error_string_ +
353 usm_free(device_queue_, device_pointer);
355 device_pointer =
nullptr;
356 allocation_success =
false;
360 return allocation_success;
363void OneapiDevice::free_device(
void *device_pointer)
365 usm_free(device_queue_, device_pointer);
368bool OneapiDevice::shared_alloc(
void *&shared_pointer,
const size_t size)
370 shared_pointer = usm_aligned_alloc_host(device_queue_,
size, 64);
371 return shared_pointer !=
nullptr;
374void OneapiDevice::shared_free(
void *shared_pointer,
const size_t )
376 usm_free(device_queue_, shared_pointer);
379void *OneapiDevice::shared_to_device_pointer(
const void *shared_pointer)
383 return const_cast<void *
>(shared_pointer);
386void OneapiDevice::copy_host_to_device(
void *device_pointer,
void *host_pointer,
const size_t size)
388 usm_memcpy(device_queue_, device_pointer, host_pointer,
size);
392SyclQueue *OneapiDevice::sycl_queue()
394 return device_queue_;
397string OneapiDevice::oneapi_error_message()
399 return string(oneapi_error_string_);
402int OneapiDevice::scene_max_shaders()
404 return scene_max_shaders_;
407void *OneapiDevice::kernel_globals_device_pointer()
409 return kg_memory_device_;
412void *OneapiDevice::host_alloc(
const MemoryType type,
const size_t size)
416# ifdef SYCL_EXT_ONEAPI_COPY_OPTIMIZE
417 if (use_intel_copy_optimization && host_pointer) {
420 sycl::queue *queue =
reinterpret_cast<sycl::queue *
>(device_queue_);
423 if (queue->get_backend() == sycl::backend::ext_oneapi_level_zero) {
424 sycl::ext::oneapi::experimental::prepare_for_device_copy(host_pointer,
size, *queue);
433void OneapiDevice::host_free(
const MemoryType type,
void *host_pointer,
const size_t size)
435# ifdef SYCL_EXT_ONEAPI_COPY_OPTIMIZE
436 if (use_intel_copy_optimization) {
438 sycl::queue *queue =
reinterpret_cast<sycl::queue *
>(device_queue_);
441 if (queue->get_backend() == sycl::backend::ext_oneapi_level_zero) {
442 sycl::ext::oneapi::experimental::release_from_device_copy(host_pointer, *queue);
454 assert(!
"mem_alloc not supported for images.");
457 assert(!
"mem_alloc not supported for global memory.");
489 generic_copy_to(mem);
518void OneapiDevice::mem_copy_from(
519 device_memory &mem,
const size_t y,
size_t w,
const size_t h,
size_t elem,
void *host_pointer)
522 assert(!
"mem_copy_from not supported for images.");
524 else if (host_pointer) {
525 const size_t size = (
w > 0 || h > 0 || elem > 0) ? (elem *
w * h) : mem.
memory_size();
526 const size_t offset = elem *
y *
w;
528 LOG_TRACE <<
"OneapiDevice::mem_copy_from: \"" << mem.
log_name() <<
"\" object of "
531 <<
" data " <<
size <<
" bytes";
543 char *shifted_host =
reinterpret_cast<char *
>(host_pointer) + offset;
544 char *shifted_device =
reinterpret_cast<char *
>(mem.
device_pointer) + offset;
545 bool is_finished_ok = usm_memcpy(device_queue_, shifted_host, shifted_device,
size);
546 if (is_finished_ok ==
false) {
547 set_error(
"oneAPI memory operation error: got runtime exception \"" +
548 oneapi_error_string_ +
"\"");
554void OneapiDevice::mem_copy_from(
555 device_memory &mem,
const size_t y,
size_t w,
const size_t h,
size_t elem)
562 mem_copy_from(mem, 0, 0, 0, 0);
585 bool is_finished_ok = usm_memset(
587 if (is_finished_ok ==
false) {
588 set_error(
"oneAPI memory operation error: got runtime exception \"" + oneapi_error_string_ +
618void OneapiDevice::const_copy_to(
const char *name,
void *host,
const size_t size)
622 LOG_TRACE <<
"OneapiDevice::const_copy_to \"" << name <<
"\" object "
626 if (strcmp(name,
"data") == 0) {
628 KernelData *
const data =
static_cast<KernelData *
>(host);
632 scene_max_shaders_ =
data->max_shaders;
634# ifdef WITH_EMBREE_GPU
635 if (embree_traversable !=
nullptr) {
639 data->device_bvh = embree_traversable;
644 ConstMemMap::iterator i = const_mem_map_.find(name);
647 if (i == const_mem_map_.end()) {
650 data_ptr->alloc(
size);
651 data = data_ptr.get();
652 const_mem_map_.insert(ConstMemMap::value_type(name, std::move(data_ptr)));
655 data = i->second.get();
660 data->copy_to_device();
662 set_global_memory(device_queue_, kg_memory_, name, (
void *)
data->device_pointer);
664 usm_memcpy(device_queue_, kg_memory_device_, kg_memory_, kg_memory_size_);
675 generic_copy_to(mem);
679 usm_memcpy(device_queue_, kg_memory_device_, kg_memory_, kg_memory_size_);
688 generic_copy_to(mem);
699# ifndef WITH_CYCLES_ONEAPI_SOFTWARE_TEXTURING
700static sycl::ext::oneapi::experimental::image_descriptor image_desc(
const device_image &mem)
703 sycl::image_channel_type channel_type;
707 channel_type = sycl::image_channel_type::unorm_int8;
710 channel_type = sycl::image_channel_type::unorm_int16;
713 channel_type = sycl::image_channel_type::fp32;
716 channel_type = sycl::image_channel_type::fp16;
719 channel_type = sycl::image_channel_type::unorm_int8;
724 sycl::ext::oneapi::experimental::image_descriptor param;
728 param.channel_type = channel_type;
740# ifndef WITH_CYCLES_ONEAPI_SOFTWARE_TEXTURING
743 sycl::addressing_mode address_mode = sycl::addressing_mode::none;
746 address_mode = sycl::addressing_mode::repeat;
749 address_mode = sycl::addressing_mode::clamp_to_edge;
752 address_mode = sycl::addressing_mode::clamp;
755 address_mode = sycl::addressing_mode::mirrored_repeat;
762 sycl::filtering_mode filter_mode;
764 filter_mode = sycl::filtering_mode::nearest;
767 filter_mode = sycl::filtering_mode::linear;
771 sycl::image_channel_type channel_type;
775 channel_type = sycl::image_channel_type::unorm_int8;
778 channel_type = sycl::image_channel_type::unorm_int16;
781 channel_type = sycl::image_channel_type::fp32;
784 channel_type = sycl::image_channel_type::fp16;
791 sycl::queue *queue =
reinterpret_cast<sycl::queue *
>(device_queue_);
795 sycl::ext::oneapi::experimental::image_mem_handle memHandle{0};
796 sycl::ext::oneapi::experimental::image_descriptor desc{};
800 const sycl::device &device =
reinterpret_cast<sycl::queue *
>(queue)->get_device();
801 const size_t max_width = device.get_info<sycl::info::device::image2d_max_width>();
802 const size_t max_height = device.get_info<sycl::info::device::image2d_max_height>();
806 string_printf(
"Maximum GPU 2D texture size exceeded (max %zux%zu, found %zux%zu)",
815 desc = sycl::ext::oneapi::experimental::image_descriptor(
822 memHandle = sycl::ext::oneapi::experimental::alloc_image_mem(desc, *queue);
823 if (!memHandle.raw_handle) {
824 set_error(
"GPU image allocation failed: Raw handle is null");
829 queue->ext_oneapi_copy(mem.
host_pointer, memHandle, desc);
836 cmem = &device_mem_map[&mem];
838 cmem->array = (arrayMemObject)(memHandle.raw_handle);
842 desc = sycl::ext::oneapi::experimental::image_descriptor(
844 cmem = generic_alloc(mem);
852 queue->wait_and_throw();
857 sycl::ext::oneapi::experimental::bindless_image_sampler samp(
858 address_mode, sycl::coordinate_normalization_mode::normalized, filter_mode);
861 sycl::ext::oneapi::experimental::sampled_image_handle imgHandle;
863 if (memHandle.raw_handle) {
865 imgHandle = sycl::ext::oneapi::experimental::create_image(memHandle, samp, desc, *queue);
869 imgHandle = sycl::ext::oneapi::experimental::create_image(
874 cmem = &device_mem_map[&mem];
875 cmem->texobject = (texMemObject)(imgHandle.raw_handle);
886 catch (sycl::exception
const &e) {
887 set_error(
"GPU image allocation failed: runtime exception \"" +
string(
e.what()) +
"\"");
895 generic_copy_to(mem);
909# ifndef WITH_CYCLES_ONEAPI_SOFTWARE_TEXTURING
912 sycl::ext::oneapi::experimental::image_descriptor desc = image_desc(mem);
914 sycl::queue *queue =
reinterpret_cast<sycl::queue *
>(device_queue_);
919 const Mem &cmem = device_mem_map[&mem];
920 sycl::ext::oneapi::experimental::image_mem_handle image_handle{
921 (sycl::ext::oneapi::experimental::image_mem_handle::raw_handle_type)cmem.array};
922 queue->ext_oneapi_copy(mem.
host_pointer, image_handle, desc);
924# ifdef WITH_CYCLES_DEBUG
925 queue->wait_and_throw();
928 catch (sycl::exception
const &e) {
929 set_error(
"oneAPI image copy error: got runtime exception \"" +
string(
e.what()) +
"\"");
933 generic_copy_to(mem);
936 generic_copy_to(mem);
944# ifndef WITH_CYCLES_ONEAPI_SOFTWARE_TEXTURING
946 DCHECK(device_mem_map.find(&mem) != device_mem_map.end());
947 const Mem &cmem = device_mem_map[&mem];
949 sycl::queue *queue =
reinterpret_cast<sycl::queue *
>(device_queue_);
951 if (cmem.texobject) {
953 sycl::ext::oneapi::experimental::sampled_image_handle
image(cmem.texobject);
954 sycl::ext::oneapi::experimental::destroy_image_handle(
image, *queue);
959 sycl::ext::oneapi::experimental::image_mem_handle imgHandle{
960 (sycl::ext::oneapi::experimental::image_mem_handle::raw_handle_type)cmem.array};
964 sycl::ext::oneapi::experimental::free_image_mem(
965 imgHandle, sycl::ext::oneapi::experimental::image_type::standard, *queue);
967 catch (sycl::exception
const &e) {
968 set_error(
"oneAPI image deallocation error: got runtime exception \"" +
string(
e.what()) +
975 device_mem_map.erase(device_mem_map.find(&mem));
989 return make_unique<OneapiDeviceQueue>(
this);
995# ifdef SYCL_LINEAR_MEMORY_INTEROP_AVAILABLE
1002 const sycl::device &device =
reinterpret_cast<sycl::queue *
>(device_queue_)->get_device();
1003 if (!device.has(sycl::aspect::ext_oneapi_external_memory_import)) {
1009 sycl::detail::uuid_type uuid = device.get_info<sycl::ext::intel::info::device::uuid>();
1010 const bool found = (uuid.size() == interop_device.
uuid.size() &&
1011 memcmp(uuid.data(), interop_device.
uuid.data(), uuid.size()) == 0);
1015 LOG_INFO <<
"Graphics interop: found matching Vulkan device for oneAPI";
1018 LOG_INFO <<
"Graphics interop: no matching Vulkan device for oneAPI";
1028 catch (sycl::exception &e) {
1029 LOG_ERROR <<
"Could not release external Vulkan memory: " <<
e.what();
1035void *OneapiDevice::usm_aligned_alloc_host(
const size_t memory_size,
const size_t alignment)
1038 return usm_aligned_alloc_host(device_queue_, memory_size, alignment);
1041void OneapiDevice::usm_free(
void *usm_ptr)
1044 usm_free(device_queue_, usm_ptr);
1047void OneapiDevice::check_usm(SyclQueue *queue_,
const void *usm_ptr,
bool allow_host =
false)
1050 sycl::queue *queue =
reinterpret_cast<sycl::queue *
>(queue_);
1051 sycl::info::device_type device_type =
1052 queue->get_device().get_info<sycl::info::device::device_type>();
1053 sycl::usm::alloc usm_type = get_pointer_type(usm_ptr, queue->get_context());
1055 const sycl::usm::alloc main_memory_type = sycl::usm::alloc::device;
1056 assert(usm_type == main_memory_type ||
1057 (usm_type == sycl::usm::alloc::host &&
1058 (allow_host || device_type == sycl::info::device_type::cpu)) ||
1059 usm_type == sycl::usm::alloc::unknown);
1068bool OneapiDevice::create_queue(SyclQueue *&external_queue,
1069 const int device_index,
1070 void *embree_device_pointer,
1071 bool *multiple_level_zero_platforms_detected_pointer)
1073 bool finished_correct =
true;
1074 *multiple_level_zero_platforms_detected_pointer =
false;
1077 std::vector<SyclDeviceEntry> devices = available_sycl_devices(
1078 multiple_level_zero_platforms_detected_pointer);
1080 if (device_index < 0 || device_index >= devices.size()) {
1084 if (devices[device_index].meets_driver_requirement ==
false) {
1085 oneapi_error_string_ =
"The device driver is too old.";
1086 LOG_ERROR <<
"Internal error: The SYCL device does not meet minimum driver requirement, but "
1087 "it was used anyway. Please report a bug.";
1091 sycl::queue *created_queue =
new sycl::queue(devices[device_index].device,
1092 sycl::property::queue::in_order());
1093 external_queue =
reinterpret_cast<SyclQueue *
>(created_queue);
1095# ifdef WITH_EMBREE_GPU
1096 if (embree_device_pointer) {
1097 RTCDevice *device_object_ptr =
reinterpret_cast<RTCDevice *
>(embree_device_pointer);
1098 *device_object_ptr = rtcNewSYCLDevice(created_queue->get_context(),
"");
1099 if (*device_object_ptr ==
nullptr) {
1100 finished_correct =
false;
1101 oneapi_error_string_ =
1102 "Hardware Raytracing is not available; please install "
1103 "\"intel-level-zero-gpu-raytracing\" to enable it or disable Embree on GPU.";
1106 rtcSetDeviceSYCLDevice(*device_object_ptr, devices[device_index].device);
1110 (void)embree_device_pointer;
1113 catch (
const sycl::exception &e) {
1114 finished_correct =
false;
1115 oneapi_error_string_ =
e.what();
1117 return finished_correct;
1120void OneapiDevice::free_queue(SyclQueue *queue_)
1123 sycl::queue *queue =
reinterpret_cast<sycl::queue *
>(queue_);
1127void *OneapiDevice::usm_aligned_alloc_host(SyclQueue *queue_,
1129 const size_t alignment)
1132 sycl::queue *queue =
reinterpret_cast<sycl::queue *
>(queue_);
1133 return sycl::aligned_alloc_host(alignment, memory_size, *queue);
1136void *OneapiDevice::usm_alloc_device(SyclQueue *queue_,
size_t memory_size)
1139 sycl::queue *queue =
reinterpret_cast<sycl::queue *
>(queue_);
1150 return sycl::malloc_device(memory_size, *queue);
1153void OneapiDevice::usm_free(SyclQueue *queue_,
void *usm_ptr)
1156 sycl::queue *queue =
reinterpret_cast<sycl::queue *
>(queue_);
1157 OneapiDevice::check_usm(queue_, usm_ptr,
true);
1158 sycl::free(usm_ptr, *queue);
1161bool OneapiDevice::usm_memcpy(SyclQueue *queue_,
void *dest,
void *src,
const size_t num_bytes)
1171 sycl::queue *queue =
reinterpret_cast<sycl::queue *
>(queue_);
1172 OneapiDevice::check_usm(queue_, dest,
true);
1173 OneapiDevice::check_usm(queue_, src,
true);
1174 sycl::usm::alloc dest_type = get_pointer_type(dest, queue->get_context());
1175 sycl::usm::alloc src_type = get_pointer_type(src, queue->get_context());
1178 if ((dest_type == sycl::usm::alloc::host || dest_type == sycl::usm::alloc::unknown) &&
1179 (src_type == sycl::usm::alloc::host || src_type == sycl::usm::alloc::unknown))
1181 memcpy(dest, src, num_bytes);
1186 sycl::event mem_event = queue->memcpy(dest, src, num_bytes);
1187# ifdef WITH_CYCLES_DEBUG
1191 mem_event.wait_and_throw();
1194 bool from_device_to_host = dest_type == sycl::usm::alloc::host &&
1195 src_type == sycl::usm::alloc::device;
1196 bool host_or_device_memop_with_offset = dest_type == sycl::usm::alloc::unknown ||
1197 src_type == sycl::usm::alloc::unknown;
1201 if (from_device_to_host || host_or_device_memop_with_offset) {
1207 catch (
const sycl::exception &e) {
1208 oneapi_error_string_ =
e.what();
1213bool OneapiDevice::usm_memset(SyclQueue *queue_,
1215 unsigned char value,
1216 const size_t num_bytes)
1226 sycl::queue *queue =
reinterpret_cast<sycl::queue *
>(queue_);
1227 OneapiDevice::check_usm(queue_, usm_ptr,
true);
1229 sycl::event mem_event = queue->memset(usm_ptr, value, num_bytes);
1230# ifdef WITH_CYCLES_DEBUG
1234 mem_event.wait_and_throw();
1240 catch (
const sycl::exception &e) {
1241 oneapi_error_string_ =
e.what();
1246bool OneapiDevice::queue_synchronize(SyclQueue *queue_)
1249 sycl::queue *queue =
reinterpret_cast<sycl::queue *
>(queue_);
1251 queue->wait_and_throw();
1254 catch (
const sycl::exception &e) {
1255 oneapi_error_string_ =
e.what();
1260bool OneapiDevice::kernel_globals_size(
size_t &kernel_global_size)
1267void OneapiDevice::set_global_memory(SyclQueue *queue_,
1268 void *kernel_globals,
1269 const char *memory_name,
1270 void *memory_device_pointer)
1275 assert(memory_device_pointer);
1277 OneapiDevice::check_usm(queue_, memory_device_pointer,
true);
1278 OneapiDevice::check_usm(queue_, kernel_globals,
true);
1280 std::string matched_name(memory_name);
1283# define KERNEL_DATA_ARRAY(type, name) \
1284 else if (#name == matched_name) \
1286 globals->__##name = (type *)memory_device_pointer; \
1291 else if (
"integrator_state" == matched_name) {
1296# include "kernel/data_arrays.h"
1299 std::cerr <<
"Can't found global/constant memory with name \"" << matched_name <<
"\"!"
1303# undef KERNEL_DATA_ARRAY
1306bool OneapiDevice::enqueue_kernel(KernelContext *kernel_context,
1308 const size_t global_size,
1312 return oneapi_enqueue_kernel(kernel_context,
1317 use_hardware_raytracing,
1321void OneapiDevice::get_adjusted_global_and_local_sizes(SyclQueue *queue,
1323 size_t &kernel_global_size,
1324 size_t &kernel_local_size)
1327 static const size_t preferred_work_group_size_intersect = 128;
1328 static const size_t preferred_work_group_size_shading = 256;
1329 static const size_t preferred_work_group_size_shading_simd8 = 64;
1332 static const size_t preferred_work_group_size_shader_evaluation = 256;
1335 static const size_t preferred_work_group_size_cryptomatte = 512;
1336 static const size_t preferred_work_group_size_default = 1024;
1338 const sycl::device &device =
reinterpret_cast<sycl::queue *
>(queue)->get_device();
1339 const size_t max_work_group_size = device.get_info<sycl::info::device::max_work_group_size>();
1341 size_t preferred_work_group_size = 0;
1351 preferred_work_group_size = preferred_work_group_size_intersect;
1363 const bool device_is_simd8 =
1364 (device.has(sycl::aspect::ext_intel_gpu_eu_simd_width) &&
1365 device.get_info<sycl::ext::intel::info::device::gpu_eu_simd_width>() == 8);
1366 preferred_work_group_size = (device_is_simd8) ? preferred_work_group_size_shading_simd8 :
1367 preferred_work_group_size_shading;
1371 preferred_work_group_size = preferred_work_group_size_cryptomatte;
1378 preferred_work_group_size = preferred_work_group_size_shader_evaluation;
1388 if (preferred_work_group_size == 0) {
1389 preferred_work_group_size = oneapi_suggested_gpu_kernel_size((
::DeviceKernel)kernel);
1393 if (preferred_work_group_size == 0) {
1394 preferred_work_group_size = preferred_work_group_size_default;
1397 kernel_local_size = std::min(max_work_group_size, preferred_work_group_size);
1401 kernel_global_size =
round_up(kernel_global_size, kernel_local_size);
1403 assert(kernel_global_size % kernel_local_size == 0);
1413static const int lowest_supported_driver_version_win = 1018306;
1418static const int lowest_supported_driver_version_neo = 35716;
1428static const int lowest_supported_driver_version_neo = 37435;
1431int parse_driver_build_version(
const sycl::device &device)
1433 const std::string &driver_version = device.get_info<sycl::info::device::driver_version>();
1434 int driver_build_version = 0;
1436 size_t second_dot_position = driver_version.find(
'.', driver_version.find(
'.') + 1);
1437 if (second_dot_position != std::string::npos) {
1439 size_t third_dot_position = driver_version.find(
'.', second_dot_position + 1);
1440 if (third_dot_position != std::string::npos) {
1441 const std::string &third_number_substr = driver_version.substr(
1442 second_dot_position + 1, third_dot_position - second_dot_position - 1);
1443 const std::string &forth_number_substr = driver_version.substr(third_dot_position + 1);
1444 if (third_number_substr.length() == 3 && forth_number_substr.length() == 4) {
1445 driver_build_version = std::stoi(third_number_substr) * 10000 +
1446 std::stoi(forth_number_substr);
1452 else if (third_number_substr.length() == 5 && forth_number_substr.length() == 6) {
1453 driver_build_version = std::stoi(third_number_substr);
1457 const std::string &third_number_substr = driver_version.substr(second_dot_position + 1);
1458 driver_build_version = std::stoi(third_number_substr);
1461 catch (std::invalid_argument &) {
1465 if (driver_build_version == 0) {
1466 LOG_WARNING <<
"Unable to parse unknown Intel GPU driver version. \"" << driver_version
1467 <<
"\" does not match xx.xx.xxxxx (Linux), x.x.xxxx (L0),"
1468 <<
" xx.xx.xxx.xxxx (Windows) for device \""
1469 << device.get_info<sycl::info::device::name>() <<
"\".";
1472 return driver_build_version;
1475std::vector<SyclDeviceEntry> available_sycl_devices(
1476 bool *multiple_level_zero_platforms_detected =
nullptr)
1478 std::vector<SyclDeviceEntry> available_devices;
1479 bool allow_all_devices =
false;
1480 if (getenv(
"CYCLES_ONEAPI_ALL_DEVICES") !=
nullptr) {
1481 allow_all_devices =
true;
1484 int level_zero_platform_counter = 0;
1486 const std::vector<sycl::platform> &oneapi_platforms = sycl::platform::get_platforms();
1488 for (
const sycl::platform &platform : oneapi_platforms) {
1492 if (platform.get_backend() == sycl::backend::opencl) {
1496 if (platform.get_backend() == sycl::backend::ext_oneapi_level_zero) {
1497 level_zero_platform_counter++;
1500 const std::vector<sycl::device> &oneapi_devices =
1501 (allow_all_devices) ? platform.get_devices(sycl::info::device_type::all) :
1502 platform.get_devices(sycl::info::device_type::gpu);
1504 for (
const sycl::device &device : oneapi_devices) {
1505 bool filter_out =
false;
1506 bool meets_driver_requirement =
true;
1508 if (!allow_all_devices) {
1512 if (!device.is_gpu() || platform.get_backend() != sycl::backend::ext_oneapi_level_zero) {
1517 int number_of_eus = 96;
1518 int threads_per_eu = 7;
1519 if (device.has(sycl::aspect::ext_intel_gpu_eu_count)) {
1520 number_of_eus = device.get_info<sycl::ext::intel::info::device::gpu_eu_count>();
1522 if (device.has(sycl::aspect::ext_intel_gpu_hw_threads_per_eu)) {
1524 device.get_info<sycl::ext::intel::info::device::gpu_hw_threads_per_eu>();
1527 if (number_of_eus <= 96 && threads_per_eu == 7) {
1530# ifndef WITH_CYCLES_ONEAPI_SOFTWARE_TEXTURING
1532 if (!filter_out && !device.has(sycl::aspect::ext_oneapi_bindless_images)) {
1535 LOG_WARNING <<
"Device \"" << device.get_info<sycl::info::device::name>()
1536 <<
"\" does not support bindless images, which Cycles oneAPI"
1537 <<
" requires. Build Blender with "
1538 <<
"WITH_CYCLES_ONEAPI_SOFTWARE_TEXTURING to use this device.";
1542 bool check_driver_version = !filter_out;
1544 if (check_driver_version &&
1545 device.get_info<sycl::info::device::vendor>().find(
"Intel") == std::string::npos)
1547 check_driver_version =
false;
1555# if __LIBSYCL_MAJOR_VERSION < 8
1556 if (check_driver_version &&
1557 !
string_startswith(device.get_info<sycl::info::device::driver_version>(),
"1.3."))
1559 check_driver_version =
false;
1562 if (check_driver_version) {
1563 int driver_build_version = parse_driver_build_version(device);
1564 const int lowest_supported_driver_version = (driver_build_version > 100000) ?
1565 lowest_supported_driver_version_win :
1566 lowest_supported_driver_version_neo;
1567 if (driver_build_version < lowest_supported_driver_version) {
1568 meets_driver_requirement =
false;
1571 << device.get_info<sycl::info::device::name>()
1572 <<
"\" is too old. Expected \"" << lowest_supported_driver_version
1573 <<
"\" or newer, but got \"" << driver_build_version <<
"\".";
1587 for (
const SyclDeviceEntry &available_entry : available_devices) {
1588 std::array<sycl::device, 2> devices = {available_entry.device, device};
1589 std::vector<sycl::ext::intel::info::device::uuid::return_type> uuids;
1590 for (
int i = 0; i < 2; i++) {
1593 if (devices[i].has(sycl::aspect::ext_intel_device_info_uuid)) {
1594 uuids.push_back(devices[i].get_info<sycl::ext::intel::info::device::uuid>());
1596 else if (devices[i].get_platform().get_info<sycl::info::platform::vendor>() ==
1597 "Intel(R) Corporation")
1602 const std::string &device_name = devices[i].get_info<sycl::info::device::name>();
1603 LOG_WARNING <<
"Despite expectation, Intel oneAPI device '" << device_name
1604 <<
"' is not supporting Intel SYCL UUID extension.";
1607 if (uuids.size() == 2) {
1608 if (uuids[0] == uuids[1]) {
1609 const std::string &device_name = device.get_info<sycl::info::device::name>();
1610 const std::string &platform_name =
1611 device.get_platform().get_info<sycl::info::platform::name>();
1613 <<
"Detecting that oneAPI device '" << device_name <<
"' of platform '"
1615 <<
"' is identical (by UUID comparison) to an already added device in the "
1616 "list of available devices, so it will not be added again.";
1625 available_devices.push_back(SyclDeviceEntry{device, meets_driver_requirement});
1630 catch (sycl::exception &e) {
1631 LOG_WARNING <<
"An error has been encountered while enumerating SYCL devices: " <<
e.what();
1634 if (multiple_level_zero_platforms_detected) {
1635 *multiple_level_zero_platforms_detected = level_zero_platform_counter > 1;
1638 return available_devices;
1641void OneapiDevice::architecture_information(
const SyclDevice *device,
1645 const sycl::ext::oneapi::experimental::architecture arch =
1646 reinterpret_cast<const sycl::device *
>(device)
1647 ->get_info<sycl::ext::oneapi::experimental::info::device::architecture>();
1649# define FILL_ARCH_INFO(architecture_code, is_arch_optimized) \
1650 case sycl::ext::oneapi::experimental::architecture ::architecture_code: \
1651 name = #architecture_code; \
1652 is_optimized = is_arch_optimized; \
1664 FILL_ARCH_INFO(intel_gpu_bdw,
false)
1665 FILL_ARCH_INFO(intel_gpu_skl, false)
1666 FILL_ARCH_INFO(intel_gpu_kbl, false)
1667 FILL_ARCH_INFO(intel_gpu_cfl, false)
1668 FILL_ARCH_INFO(intel_gpu_apl, false)
1670 FILL_ARCH_INFO(intel_gpu_glk, false)
1671 FILL_ARCH_INFO(intel_gpu_whl, false)
1672 FILL_ARCH_INFO(intel_gpu_aml, false)
1673 FILL_ARCH_INFO(intel_gpu_cml, false)
1674 FILL_ARCH_INFO(intel_gpu_icllp, false)
1676 FILL_ARCH_INFO(intel_gpu_ehl, false)
1678 FILL_ARCH_INFO(intel_gpu_tgllp, false)
1680 FILL_ARCH_INFO(intel_gpu_rkl, false)
1681 FILL_ARCH_INFO(intel_gpu_adl_s, false)
1683 FILL_ARCH_INFO(intel_gpu_adl_p, false)
1684 FILL_ARCH_INFO(intel_gpu_adl_n, false)
1685 FILL_ARCH_INFO(intel_gpu_dg1, false)
1686 FILL_ARCH_INFO(intel_gpu_acm_g10, true)
1688 FILL_ARCH_INFO(intel_gpu_acm_g11, true)
1690 FILL_ARCH_INFO(intel_gpu_acm_g12, true)
1692 FILL_ARCH_INFO(intel_gpu_pvc, false)
1693 FILL_ARCH_INFO(intel_gpu_pvc_vg, false)
1694 FILL_ARCH_INFO(intel_gpu_mtl_u, true)
1698 FILL_ARCH_INFO(intel_gpu_mtl_h, true)
1699 FILL_ARCH_INFO(intel_gpu_arl_h, true)
1700 FILL_ARCH_INFO(intel_gpu_bmg_g21, true)
1701 FILL_ARCH_INFO(intel_gpu_bmg_g31, true)
1702 FILL_ARCH_INFO(intel_gpu_lnl_m, true)
1703 FILL_ARCH_INFO(intel_gpu_ptl_h, true)
1704 FILL_ARCH_INFO(intel_gpu_ptl_u, true)
1705 FILL_ARCH_INFO(intel_gpu_wcl, true)
1709 is_optimized = false;
1714char *OneapiDevice::device_capabilities()
1716 std::stringstream capabilities;
1718 const std::vector<SyclDeviceEntry> &entries = available_sycl_devices();
1719 for (
const SyclDeviceEntry &entry : entries) {
1720 const sycl::device &device = entry.device;
1722 const std::string &name = device.get_info<sycl::info::device::name>();
1724 capabilities << std::string(
"\t") << name <<
"\n";
1725 capabilities <<
"\t\tsycl::info::platform::name\t\t\t"
1726 << device.get_platform().get_info<sycl::info::platform::name>() <<
"\n";
1729 bool is_optimized_for_arch;
1730 architecture_information(
1731 reinterpret_cast<const SyclDevice *
>(&device), arch_name, is_optimized_for_arch);
1732 capabilities <<
"\t\tsycl::info::device::architecture\t\t\t";
1733 capabilities << arch_name <<
"\n";
1734 capabilities <<
"\t\tsycl::info::device::is_cycles_optimized\t\t\t";
1735 capabilities << is_optimized_for_arch <<
"\n";
1736 capabilities <<
"\t\tsycl::info::device::meets_driver_requirement\t\t\t";
1737 capabilities << entry.meets_driver_requirement <<
"\n";
1739# define WRITE_ATTR(attribute_name, attribute_variable) \
1740 capabilities << "\t\tsycl::info::device::" #attribute_name "\t\t\t" << attribute_variable \
1742# define GET_ATTR(attribute) \
1744 capabilities << "\t\tsycl::info::device::" #attribute "\t\t\t" \
1745 << device.get_info<sycl::info::device ::attribute>() << "\n"; \
1747# define GET_INTEL_ATTR(attribute) \
1749 if (device.has(sycl::aspect::ext_intel_##attribute)) { \
1750 capabilities << "\t\tsycl::ext::intel::info::device::" #attribute "\t\t\t" \
1751 << device.get_info<sycl::ext::intel::info::device ::attribute>() << "\n"; \
1754# define GET_ASPECT(aspect_) \
1756 capabilities << "\t\tdevice::has(" #aspect_ ")\t\t\t" << device.has(sycl::aspect ::aspect_) \
1761 GET_ATTR(driver_version)
1762 GET_ATTR(max_compute_units)
1763 GET_ATTR(max_clock_frequency)
1764 GET_ATTR(global_mem_size)
1765 GET_INTEL_ATTR(pci_address)
1766 GET_INTEL_ATTR(gpu_eu_simd_width)
1767 GET_INTEL_ATTR(gpu_eu_count)
1768 GET_INTEL_ATTR(gpu_slices)
1769 GET_INTEL_ATTR(gpu_subslices_per_slice)
1770 GET_INTEL_ATTR(gpu_eu_count_per_subslice)
1771 GET_INTEL_ATTR(gpu_hw_threads_per_eu)
1772 GET_INTEL_ATTR(max_mem_bandwidth)
1773 GET_ATTR(max_work_group_size)
1774 GET_ATTR(max_work_item_dimensions)
1775 sycl::id<3> max_work_item_sizes =
1776 device.get_info<sycl::info::device::max_work_item_sizes<3>>();
1777 WRITE_ATTR(max_work_item_sizes[0], max_work_item_sizes.get(0))
1778 WRITE_ATTR(max_work_item_sizes[1], max_work_item_sizes.get(1))
1779 WRITE_ATTR(max_work_item_sizes[2], max_work_item_sizes.get(2))
1781 GET_ATTR(max_num_sub_groups)
1782 for (
size_t sub_group_size : device.get_info<sycl::info::device::sub_group_sizes>()) {
1783 WRITE_ATTR(sub_group_size[], sub_group_size)
1785 GET_ATTR(sub_group_independent_forward_progress)
1787 GET_ATTR(preferred_vector_width_char)
1788 GET_ATTR(preferred_vector_width_short)
1789 GET_ATTR(preferred_vector_width_int)
1790 GET_ATTR(preferred_vector_width_long)
1791 GET_ATTR(preferred_vector_width_float)
1792 GET_ATTR(preferred_vector_width_double)
1793 GET_ATTR(preferred_vector_width_half)
1795 GET_ATTR(address_bits)
1796 GET_ATTR(max_mem_alloc_size)
1797 GET_ATTR(mem_base_addr_align)
1798 GET_ATTR(error_correction_support)
1799 GET_ATTR(is_available)
1800 GET_ATTR(host_unified_memory)
1805 GET_ASPECT(atomic64)
1806 GET_ASPECT(usm_host_allocations)
1807 GET_ASPECT(usm_device_allocations)
1808 GET_ASPECT(usm_shared_allocations)
1809 GET_ASPECT(usm_system_allocations)
1811# ifdef __SYCL_ANY_DEVICE_HAS_ext_oneapi_non_uniform_groups__
1812 GET_ASPECT(ext_oneapi_non_uniform_groups)
1814# ifdef __SYCL_ANY_DEVICE_HAS_ext_oneapi_bindless_images__
1815 GET_ASPECT(ext_oneapi_bindless_images)
1817# ifdef __SYCL_ANY_DEVICE_HAS_ext_oneapi_interop_semaphore_import__
1818 GET_ASPECT(ext_oneapi_interop_semaphore_import)
1820# ifdef __SYCL_ANY_DEVICE_HAS_ext_oneapi_interop_semaphore_export__
1821 GET_ASPECT(ext_oneapi_interop_semaphore_export)
1824# undef GET_INTEL_ATTR
1828 capabilities <<
"\n";
1831 return ::strdup(capabilities.str().c_str());
1834void OneapiDevice::iterate_devices(OneAPIDeviceIteratorCallback cb,
void *user_ptr)
1837 std::vector<SyclDeviceEntry> entries = available_sycl_devices();
1838 for (
const SyclDeviceEntry &entry : entries) {
1839 const sycl::device &device = entry.device;
1841 const std::string &platform_name =
1842 device.get_platform().get_info<sycl::info::platform::name>();
1843 std::string name = device.get_info<sycl::info::device::name>();
1844# ifdef WITH_EMBREE_GPU
1845 bool hwrt_support = rtcIsSYCLDeviceSupported(device);
1847 bool hwrt_support =
false;
1849# if defined(WITH_OPENIMAGEDENOISE) && OIDN_VERSION >= 20300
1850 bool oidn_support = oidnIsSYCLDeviceSupported(&device);
1852 bool oidn_support =
false;
1854 std::string
id =
"ONEAPI_" + platform_name +
"_" + name;
1857 bool is_optimized_for_arch;
1858 architecture_information(
1859 reinterpret_cast<const SyclDevice *
>(&device), arch_name, is_optimized_for_arch);
1861 if (device.has(sycl::aspect::ext_intel_pci_address)) {
1862 id.append(
"_" + device.get_info<sycl::ext::intel::info::device::pci_address>());
1869 is_optimized_for_arch,
1870 entry.meets_driver_requirement,
1876size_t OneapiDevice::get_memcapacity()
1878 return reinterpret_cast<sycl::queue *
>(device_queue_)
1880 .get_info<sycl::info::device::global_mem_size>();
1883int OneapiDevice::get_num_multiprocessors()
1885 const sycl::device &device =
reinterpret_cast<sycl::queue *
>(device_queue_)->get_device();
1886 if (device.has(sycl::aspect::ext_intel_gpu_eu_count)) {
1887 return device.get_info<sycl::ext::intel::info::device::gpu_eu_count>();
1889 return device.get_info<sycl::info::device::max_compute_units>();
1892int OneapiDevice::get_max_num_threads_per_multiprocessor()
1894 const sycl::device &device =
reinterpret_cast<sycl::queue *
>(device_queue_)->get_device();
1895 if (device.has(sycl::aspect::ext_intel_gpu_eu_simd_width) &&
1896 device.has(sycl::aspect::ext_intel_gpu_hw_threads_per_eu))
1898 return device.get_info<sycl::ext::intel::info::device::gpu_eu_simd_width>() *
1899 device.get_info<sycl::ext::intel::info::device::gpu_hw_threads_per_eu>();
1903 return device.get_info<sycl::info::device::max_work_group_size>();
unsigned long long int uint64_t
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void refit(btStridingMeshInterface *triangles, const btVector3 &aabbMin, const btVector3 &aabbMax)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
bool use_hardware_raytracing
virtual void host_free(const MemoryType type, void *host_pointer, const size_t size)
virtual void build_bvh(BVH *bvh, Progress &progress, bool refit)
virtual void * host_alloc(const MemoryType type, const size_t size)
void mem_alloc(const size_t size)
void mem_free(const size_t size)
string log_name() const override
size_t memory_elements_size(const int elements)
const char * global_name() const
device_ptr device_pointer
virtual string log_name() const
#define KERNEL_DATA_ARRAY(type, name)
#define KERNEL_FEATURE_NODE_RAYTRACE
#define KERNEL_FEATURE_MNEE
#define CCL_NAMESPACE_END
#define assert(assertion)
#define image(slot, qualifiers, format)
@ DEVICE_KERNEL_INTEGRATOR_SHADE_DEDICATED_LIGHT
@ DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE
@ DEVICE_KERNEL_SHADER_EVAL_DISPLACE
@ DEVICE_KERNEL_INTEGRATOR_INTERSECT_MNEE
@ DEVICE_KERNEL_SHADER_EVAL_VOLUME_DENSITY
@ DEVICE_KERNEL_INTEGRATOR_INTERSECT_SUBSURFACE
@ DEVICE_KERNEL_INTEGRATOR_SHADE_SHADOW
@ DEVICE_KERNEL_INTEGRATOR_INTERSECT_VOLUME_STACK
@ DEVICE_KERNEL_SHADER_EVAL_BACKGROUND
@ DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE_RAYTRACE
@ DEVICE_KERNEL_INTEGRATOR_INTERSECT_DEDICATED_LIGHT
@ DEVICE_KERNEL_INTEGRATOR_INIT_FROM_CAMERA
@ DEVICE_KERNEL_INTEGRATOR_SHADE_LIGHT_FORWARD
@ DEVICE_KERNEL_INTEGRATOR_SHADE_VOLUME_RAY_MARCHING
@ DEVICE_KERNEL_INTEGRATOR_SHADE_LIGHT_NEE
@ DEVICE_KERNEL_CRYPTOMATTE_POSTPROCESS
@ DEVICE_KERNEL_INTEGRATOR_INIT_FROM_BAKE
@ DEVICE_KERNEL_SHADER_EVAL_CURVE_SHADOW_TRANSPARENCY
@ DEVICE_KERNEL_INTEGRATOR_SHADE_VOLUME
@ DEVICE_KERNEL_INTEGRATOR_INTERSECT_SHADOW
@ DEVICE_KERNEL_INTEGRATOR_INTERSECT_CLOSEST
@ DEVICE_KERNEL_INTEGRATOR_SHADE_BACKGROUND
#define DCHECK(expression)
void free(struct bMotionPath *mpath)
BMesh const char void * data
ATTR_WARN_UNUSED_RESULT const size_t num
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
string string_human_readable_size(size_t size)
string string_hex(const uint8_t *data, const size_t size)
string string_human_readable_number(size_t num)
bool string_startswith(const string_view s, const string_view start)
CCL_NAMESPACE_BEGIN string string_printf(const char *format,...)
CCL_NAMESPACE_END IntegratorStateGPU * integrator_state
std::unique_lock< std::mutex > thread_scoped_lock
ccl_device_inline size_t round_up(const size_t x, const size_t multiple)
ccl_device_inline bool is_nanovdb_type(int type)