// ======================================================================== // // Copyright 2009-2017 Intel Corporation // // // // Licensed under the Apache License, Version 2.0 (the "License"); // // you may not use this file except in compliance with the License. // // You may obtain a copy of the License at // // // // http://www.apache.org/licenses/LICENSE-2.0 // // // // Unless required by applicable law or agreed to in writing, software // // distributed under the License is distributed on an "AS IS" BASIS, // // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // // See the License for the specific language governing permissions and // // limitations under the License. // // ======================================================================== // #include "stat.h" namespace embree { Stat Stat::instance; Stat::Stat () { } Stat::~Stat () { #ifdef EMBREE_STAT_COUNTERS Stat::print(std::cout); #endif } void Stat::print(std::ostream& cout) { Counters& cntrs = instance.cntrs; /* print absolute numbers */ cout << "--------- ABSOLUTE ---------" << std::endl; cout << " #normal_travs = " << float(cntrs.code.normal.travs )*1E-6 << "M" << std::endl; cout << " #nodes = " << float(cntrs.code.normal.trav_nodes )*1E-6 << "M" << std::endl; cout << " #nodes_xfm = " << float(cntrs.code.normal.trav_xfm_nodes )*1E-6 << "M" << std::endl; cout << " #leaves = " << float(cntrs.code.normal.trav_leaves )*1E-6 << "M" << std::endl; cout << " #prims = " << float(cntrs.code.normal.trav_prims )*1E-6 << "M" << std::endl; cout << " #prim_hits = " << float(cntrs.code.normal.trav_prim_hits )*1E-6 << "M" << std::endl; cout << " #stack nodes = " << float(cntrs.code.normal.trav_stack_nodes )*1E-6 << "M" << std::endl; cout << " #stack pop = " << float(cntrs.code.normal.trav_stack_pop )*1E-6 << "M" << std::endl; size_t normal_box_hits = 0; size_t weighted_box_hits = 0; for (size_t i=0;i