Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Hallade <xavier.hallade@intel.com>2022-07-06 19:50:25 +0300
committerXavier Hallade <xavier.hallade@intel.com>2022-07-06 19:55:38 +0300
commitdebb2337877ae333b6cf3e4dc3876a6ded4f08c3 (patch)
tree9bfef9e4ef9766d118af7f971c5c93d6781ee7b1
parentfae68ec651c8717da09089cae324d20c76db6318 (diff)
Cleanup: fix comments in oneAPI kernel.cpp
-rw-r--r--intern/cycles/kernel/device/oneapi/kernel.cpp36
1 files changed, 17 insertions, 19 deletions
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_)