| 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>; |
no test coverage detected