34 return a.size > b.
size;
40 return a.time > b.
time;
87 const string double_indent = indent + indent;
96 double_indent.c_str(),
107 const string double_indent = indent + indent;
113 "%s%-40s %fs\n", double_indent.c_str(), entry.
name.c_str(), entry.
time);
125 : name(name), self_samples(samples), sum_samples(samples)
148 if (total_samples == 0) {
158 string info =
string_printf(
"%-32s: Total %3.2f%% (%.2fs), Self %3.2f%% (%.2fs)\n",
164 string result = indent + info;
176 : name(name), samples(samples), hits(hits)
186 entry_map::iterator entry =
entries.find(name);
188 entry->second.samples += samples;
189 entry->second.hits += hits;
200 sorted_entries.reserve(
entries.size());
202 uint64_t total_hits = 0, total_samples = 0;
203 foreach (entry_map::const_reference entry,
entries) {
206 total_hits += pair.
hits;
209 sorted_entries.push_back(pair);
211 const double avg_samples_per_hit = ((
double)total_samples) / total_hits;
213 sort(sorted_entries.begin(), sorted_entries.end(), namedSampleCountPairComparator);
217 const double seconds = entry.samples * 0.001;
218 const double relative = ((
double)entry.samples) / (entry.hits * avg_samples_per_hit);
222 "%-32s: %.2fs (Relative cost: %.2f)\n", entry.name.c_str(), seconds, relative);
304 denoising.
add_entry(
"Construct Transform",
343 result +=
"Profiling information not available (only works with CPU rendering)";
367 result +=
"Object:\n" +
object.full_report(1);
387 object.times.clear();
typedef double(DMatrix)[4][4]
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void sort(btMatrix3x3 &U, btVector3 &sigma, btMatrix3x3 &V, int t)
Helper function of 3X3 SVD for sorting singular values.
string full_report(int indent_level=0)
string full_report(int indent_level=0)
string full_report(int indent_level=0, uint64_t total_samples=0)
vector< NamedNestedSampleStats > entries
NamedNestedSampleStats & add_entry(const string &name, uint64_t samples)
NamedSampleCountPair(const ustring &name, uint64_t samples, uint64_t hits)
string full_report(int indent_level=0)
void add(const ustring &name, uint64_t samples, uint64_t hits)
void add_entry(const NamedSizeEntry &entry)
string full_report(int indent_level=0)
vector< NamedSizeEntry > entries
string full_report(int indent_level=0)
vector< NamedTimeEntry > entries
uint64_t get_event(ProfilingEvent event)
bool get_shader(int shader, uint64_t &samples, uint64_t &hits)
bool get_object(int object, uint64_t &samples, uint64_t &hits)
UpdateTimeStats background
UpdateTimeStats particles
UpdateTimeStats procedurals
UpdateTimeStats integrator
string full_report(int indent_level=0)
#define CCL_NAMESPACE_END
void KERNEL_FUNCTION_FULL_NAME() shader(KernelGlobals *kg, uint4 *input, float4 *output, int type, int filter, int i, int offset, int sample)
Intersection< segment > intersection
static CCL_NAMESPACE_BEGIN int kIndentNumSpaces
unsigned __int64 uint64_t
int get_device_index() const
void collect_profiling(Scene *scene, Profiler &prof)
NamedSampleCountStats shaders
NamedNestedSampleStats kernel
NamedSampleCountStats objects
vector< Shader * > shaders
vector< Object * > objects
@ PROFILING_PATH_INTEGRATE
@ PROFILING_SURFACE_BOUNCE
@ PROFILING_DENOISING_COMBINE_HALVES
@ PROFILING_INTERSECT_LOCAL
@ PROFILING_CLOSURE_SAMPLE
@ PROFILING_INTERSECT_VOLUME_ALL
@ PROFILING_INTERSECT_SHADOW_ALL
@ PROFILING_CLOSURE_VOLUME_SAMPLE
@ PROFILING_DENOISING_RECONSTRUCT
@ PROFILING_DENOISING_GET_FEATURE
@ PROFILING_DENOISING_DIVIDE_SHADOW
@ PROFILING_CONNECT_LIGHT
@ PROFILING_SCENE_INTERSECT
@ PROFILING_CLOSURE_VOLUME_EVAL
@ PROFILING_INTERSECT_VOLUME
@ PROFILING_DENOISING_DETECT_OUTLIERS
@ PROFILING_DENOISING_CONSTRUCT_TRANSFORM
@ PROFILING_INDIRECT_EMISSION
@ PROFILING_DENOISING_NON_LOCAL_MEANS
string string_human_readable_size(size_t size)
string string_human_readable_number(size_t num)
CCL_NAMESPACE_BEGIN string string_printf(const char *format,...)