Cycles: Add sample-based runtime profiler that measures time spent in various parts...
authorLukas Stockner <lukas.stockner@freenet.de>
Thu, 29 Nov 2018 01:06:30 +0000 (02:06 +0100)
committerLukas Stockner <lukas.stockner@freenet.de>
Thu, 29 Nov 2018 01:45:24 +0000 (02:45 +0100)
commit7fa6f72084b1364cddfbef4f06bbb244210d6967
treeae4f682248bd5ba4f716ff60c6dbd67c5684b3d2
parentfb057153b05555606d801d1e942113d40ec15cec
Cycles: Add sample-based runtime profiler that measures time spent in various parts of the CPU kernel

This commit adds a sample-based profiler that runs during CPU rendering and collects statistics on time spent in different parts of the kernel (ray intersection, shader evaluation etc.) as well as time spent per material and object.

The results are currently not exposed in the user interface or per Python yet, to see the stats on the console pass the "--cycles-print-stats" argument to Cycles (e.g. "./blender -- --cycles-print-stats").

Unfortunately, there is no clear way to extend this functionality to CUDA or OpenCL, so it is CPU-only for now.

Reviewers: brecht, sergey, swerner

Reviewed By: brecht, swerner

Differential Revision: https://developer.blender.org/D3892
26 files changed:
intern/cycles/blender/blender_session.cpp
intern/cycles/blender/blender_sync.cpp
intern/cycles/device/device.cpp
intern/cycles/device/device.h
intern/cycles/device/device_cpu.cpp
intern/cycles/device/device_denoising.cpp
intern/cycles/device/device_denoising.h
intern/cycles/kernel/CMakeLists.txt
intern/cycles/kernel/bvh/bvh.h
intern/cycles/kernel/kernel_globals.h
intern/cycles/kernel/kernel_passes.h
intern/cycles/kernel/kernel_path.h
intern/cycles/kernel/kernel_path_subsurface.h
intern/cycles/kernel/kernel_path_surface.h
intern/cycles/kernel/kernel_profiling.h [new file with mode: 0644]
intern/cycles/kernel/kernel_shader.h
intern/cycles/render/object.cpp
intern/cycles/render/object.h
intern/cycles/render/session.cpp
intern/cycles/render/session.h
intern/cycles/render/stats.cpp
intern/cycles/render/stats.h
intern/cycles/util/CMakeLists.txt
intern/cycles/util/util_profiling.cpp [new file with mode: 0644]
intern/cycles/util/util_profiling.h [new file with mode: 0644]
intern/cycles/util/util_stats.h