Commit: debb2337877ae333b6cf3e4dc3876a6ded4f08c3 Author: Xavier Hallade Date: Wed Jul 6 18:50:25 2022 +0200 Branches: master https://developer.blender.org/rBdebb2337877ae333b6cf3e4dc3876a6ded4f08c3
Cleanup: fix comments in oneAPI kernel.cpp =================================================================== M intern/cycles/kernel/device/oneapi/kernel.cpp =================================================================== diff --git a/intern/cycles/kernel/device/oneapi/kernel.cpp b/intern/cycles/kernel/device/oneapi/kernel.cpp index ec979db2455..329d8c032f7 100644 --- a/intern/cycles/kernel/device/oneapi/kernel.cpp +++ b/intern/cycles/kernel/device/oneapi/kernel.cpp @@ -104,11 +104,10 @@ bool oneapi_usm_memcpy(SyclQueue *queue_, void *dest, void *src, size_t num_byte oneapi_check_usm(queue_, dest, true); oneapi_check_usm(queue_, src, true); sycl::event mem_event = queue->memcpy(dest, src, num_bytes); -#ifdef WITH_CYCLES_DEBUG +# ifdef WITH_CYCLES_DEBUG try { - /* NOTE(@nsirgien) Waiting on memory operation may give more preciese error - * messages in case of the problems, but due to impact on occupancy - * make sense enable it only during cycles debugging + /* NOTE(@nsirgien) Waiting on memory operation may give more precise error + * messages. Due to impact on occupancy, it makes sense to enable it only during Cycles debug. */ mem_event.wait_and_throw(); return true; @@ -119,20 +118,20 @@ bool oneapi_usm_memcpy(SyclQueue *queue_, void *dest, void *src, size_t num_byte } return false; } -#else +# else sycl::usm::alloc dest_type = get_pointer_type(dest, queue->get_context()); sycl::usm::alloc src_type = get_pointer_type(src, queue->get_context()); - bool from_device_to_host - = dest_type == sycl::usm::alloc::host && src_type == sycl::usm::alloc::device; - bool host_or_device_memop_with_offset - = dest_type == sycl::usm::alloc::unknown || src_type == sycl::usm::alloc::unknown; - /* NOTE(@sirgienko) Host-side blocking wait on this operations is mandatory, host - * may don't wait until end of transfer before using the memory. + bool from_device_to_host = dest_type == sycl::usm::alloc::host && + src_type == sycl::usm::alloc::device; + bool host_or_device_memop_with_offset = dest_type == sycl::usm::alloc::unknown || + src_type == sycl::usm::alloc::unknown; + /* NOTE(@sirgienko) Host-side blocking wait on this operation is mandatory, otherwise the host + * may not wait until the end of the transfer before using the memory. */ - if(from_device_to_host || host_or_device_memop_with_offset) + if (from_device_to_host || host_or_device_memop_with_offset) mem_event.wait(); return true; -#endif +# endif } bool oneapi_usm_memset(SyclQueue *queue_, void *usm_ptr, unsigned char value, size_t num_bytes) @@ -141,11 +140,10 @@ bool oneapi_usm_memset(SyclQueue *queue_, void *usm_ptr, unsigned char value, si sycl::queue *queue = reinterpret_cast<sycl::queue *>(queue_); oneapi_check_usm(queue_, usm_ptr, true); sycl::event mem_event = queue->memset(usm_ptr, value, num_bytes); -#ifdef WITH_CYCLES_DEBUG +# ifdef WITH_CYCLES_DEBUG try { - /* NOTE(@nsirgien) Waiting on memory operation may give more preciese error - * messages in case of the problems, but due to impact on occupancy - * make sense enable it only during cycles debugging + /* NOTE(@nsirgien) Waiting on memory operation may give more precise error + * messages. Due to impact on occupancy, it makes sense to enable it only during Cycles debug. */ mem_event.wait_and_throw(); return true; @@ -156,10 +154,10 @@ bool oneapi_usm_memset(SyclQueue *queue_, void *usm_ptr, unsigned char value, si } return false; } -#else +# else (void)mem_event; return true; -#endif +# endif } bool oneapi_queue_synchronize(SyclQueue *queue_) _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs