MCPcopy Create free account
hub / github.com/RenderKit/embree / postBuild

Method postBuild

kernels/bvh/bvh.cpp:130–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128
129 template<int N>
130 void BVHN<N>::postBuild(double t0)
131 {
132 if (t0 == double(inf))
133 return;
134
135 double dt = 0.0;
136 if (device->benchmark || device->verbosity(2))
137 dt = getSeconds()-t0;
138
139 std::unique_ptr<BVHNStatistics<N>> stat;
140
141 /* print statistics */
142 if (device->verbosity(2))
143 {
144 if (!stat) stat.reset(new BVHNStatistics<N>(this));
145 const size_t usedBytes = alloc.getUsedBytes();
146 Lock<MutexSys> lock(g_printMutex);
147 std::cout << "finished BVH" << N << "<" << primTy->name() << "> : " << 1000.0f*dt << "ms, " << 1E-6*double(numPrimitives)/dt << " Mprim/s, " << 1E-9*double(usedBytes)/dt << " GB/s" << std::endl;
148
149 if (device->verbosity(2))
150 std::cout << stat->str();
151
152 if (device->verbosity(2))
153 {
154 FastAllocator::AllStatistics stat(&alloc);
155 for (size_t i=0; i<objects.size(); i++)
156 if (objects[i])
157 stat = stat + FastAllocator::AllStatistics(&objects[i]->alloc);
158
159 stat.print(numPrimitives);
160 }
161
162 if (device->verbosity(3))
163 {
164 alloc.print_blocks();
165 for (size_t i=0; i<objects.size(); i++)
166 if (objects[i])
167 objects[i]->alloc.print_blocks();
168 }
169
170 std::cout << std::flush;
171 }
172
173 /* benchmark mode */
174 if (device->benchmark)
175 {
176 if (!stat) stat.reset(new BVHNStatistics<N>(this));
177 Lock<MutexSys> lock(g_printMutex);
178 std::cout << "BENCHMARK_BUILD " << dt << " " << double(numPrimitives)/dt << " " << stat->sah() << " " << stat->bytesUsed() << " BVH" << N << "<" << primTy->name() << ">" << std::endl << std::flush;
179 }
180 }
181
182#if defined(__AVX__)
183 template class BVHN<8>;

Callers 11

buildMethod · 0.80
buildMethod · 0.80
buildMethod · 0.80
buildMethod · 0.80
buildMethod · 0.80
buildMethod · 0.80
buildMethod · 0.80
buildMethod · 0.80
buildMethod · 0.80
buildMethod · 0.80
buildMethod · 0.80

Calls 12

getSecondsFunction · 0.85
AllStatisticsClass · 0.85
print_blocksMethod · 0.80
bytesUsedMethod · 0.80
verbosityMethod · 0.45
resetMethod · 0.45
getUsedBytesMethod · 0.45
nameMethod · 0.45
strMethod · 0.45
sizeMethod · 0.45
printMethod · 0.45
sahMethod · 0.45

Tested by

no test coverage detected