<commit_before>// ======================================================================== //
// Copyright 2009-2015 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.                                           //
// ======================================================================== //

#pragma once

#include "../bvh/bvh.h"
#include "../geometry/primitive.h"
#include "../builders/heuristic_binning_array_aligned.h"
#include "../builders/heuristic_binning_array_unaligned.h"

#if !defined(_WIN32) || _MSC_VER >= 1700 // workaround of internal compiler bug in VS2010
#include "../builders/heuristic_strand_array.h"
#endif

namespace embree
{
  namespace isa
  {
    template<typename CreateAllocFunc, 
             typename CreateAlignedNodeFunc, 
             typename CreateUnalignedNodeFunc, 
             typename CreateLeafFunc, 
             typename ProgressMonitor>

      class BVH4BuilderHair 
    {
      ALIGNED_CLASS;

      typedef FastAllocator::ThreadLocal2* Allocator;

      static const size_t MAX_BRANCHING_FACTOR = 16;         //!< maximal supported BVH branching factor
      static const size_t MIN_LARGE_LEAF_LEVELS = 8;         //!< create balanced tree of we are that many levels before the maximal tree depth
      static const size_t SINGLE_THREADED_THRESHOLD = 4096;  //!< threshold to switch to single threaded build

      static const size_t travCostAligned = 1;
      static const size_t travCostUnaligned = 3; // FIXME: find best cost
      static const size_t intCost = 1; // FIXME: was 6

    public:
      
      BVH4BuilderHair (BezierPrim* prims, 
                       const CreateAllocFunc& createAlloc, 
                       const CreateAlignedNodeFunc& createAlignedNode, <commit_msg>tuned travCost and intCost of hair builder, +10 performance<commit_after>// ======================================================================== //
// Copyright 2009-2015 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.                                           //
// ======================================================================== //

#pragma once

#include "../bvh/bvh.h"
#include "../geometry/primitive.h"
#include "../builders/heuristic_binning_array_aligned.h"
#include "../builders/heuristic_binning_array_unaligned.h"

#if !defined(_WIN32) || _MSC_VER >= 1700 // workaround of internal compiler bug in VS2010
#include "../builders/heuristic_strand_array.h"
#endif

namespace embree
{
  namespace isa
  {
    template<typename CreateAllocFunc, 
             typename CreateAlignedNodeFunc, 
             typename CreateUnalignedNodeFunc, 
             typename CreateLeafFunc, 
             typename ProgressMonitor>

      class BVH4BuilderHair 
    {
      ALIGNED_CLASS;

      typedef FastAllocator::ThreadLocal2* Allocator;

      static const size_t MAX_BRANCHING_FACTOR = 16;         //!< maximal supported BVH branching factor
      static const size_t MIN_LARGE_LEAF_LEVELS = 8;         //!< create balanced tree of we are that many levels before the maximal tree depth
      static const size_t SINGLE_THREADED_THRESHOLD = 4096;  //!< threshold to switch to single threaded build

      static const size_t travCostAligned = 1;
      static const size_t travCostUnaligned = 5;
      static const size_t intCost = 6;

    public:
      
      BVH4BuilderHair (BezierPrim* prims, 
                       const CreateAllocFunc& createAlloc, 
                       const CreateAlignedNodeFunc& createAlignedNode, 
{'fraction_non_alphanumeric': 0.12620442093330814, 'fraction_numerical': 0.013791800491214812, 'mean_word_length': 1.7487019730010385, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 26, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '914821', 'n_tokens_mistral': 1309, 'n_tokens_neox': 1167, 'n_words': 401}