diff options
author | Nikita Sirgienko <nikita.sirgienko@intel.com> | 2022-10-10 17:37:40 +0300 |
---|---|---|
committer | Nikita Sirgienko <nikita.sirgienko@intel.com> | 2022-10-10 17:38:11 +0300 |
commit | 82a5790d2adf17fd30730166dbde60eabaedaab5 (patch) | |
tree | 8777eb8f3d6ca396d509863e3bf70382b882c8de /intern/cycles/device | |
parent | bb8dba8609ed86bb0bd9bc231a84a352c293a14d (diff) |
Cycles: oneAPI: Trigger compilation of used kernels only
JIT compilation of oneAPI kernels now happens during load stage
and proper message gets shown in the GUI during compilation.
Also, this implementation skips kernels that aren't needed for
the used scene, reducing overall (re)compilation time.
Diffstat (limited to 'intern/cycles/device')
-rw-r--r-- | intern/cycles/device/oneapi/device_impl.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/intern/cycles/device/oneapi/device_impl.cpp b/intern/cycles/device/oneapi/device_impl.cpp index 2df605fa047..4e2d4b5fe17 100644 --- a/intern/cycles/device/oneapi/device_impl.cpp +++ b/intern/cycles/device/oneapi/device_impl.cpp @@ -88,18 +88,26 @@ BVHLayoutMask OneapiDevice::get_bvh_layout_mask() const bool OneapiDevice::load_kernels(const uint requested_features) { assert(device_queue_); - /* NOTE(@nsirgien): oneAPI can support compilation of kernel code with certain feature set - * with specialization constants, but it hasn't been implemented yet. */ - (void)requested_features; bool is_finished_ok = oneapi_run_test_kernel(device_queue_); if (is_finished_ok == false) { - set_error("oneAPI kernel load: got runtime exception \"" + oneapi_error_string_ + "\""); + set_error("oneAPI test kernel execution: got a runtime exception \"" + oneapi_error_string_ + + "\""); + return false; } else { - VLOG_INFO << "Runtime compilation done for \"" << info.description << "\""; + VLOG_INFO << "Test kernel has been executed successfully for \"" << info.description << "\""; assert(device_queue_); } + + is_finished_ok = oneapi_load_kernels(device_queue_, (const unsigned int)requested_features); + if (is_finished_ok == false) { + set_error("oneAPI kernels loading: got a runtime exception \"" + oneapi_error_string_ + "\""); + } + else { + VLOG_INFO << "Kernels loading (compilation) has been done for \"" << info.description << "\""; + } + return is_finished_ok; } |