<commit_before>## ======================================================================== ##
## 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.                                           ##
## ======================================================================== ##

SET(EMBREE_VERSION_REQUIRED 2.13.0)

# Find existing Embree on the machine #######################################

FIND_PACKAGE(embree ${EMBREE_VERSION_REQUIRED} QUIET)
IF(NOT DEFINED EMBREE_INCLUDE_DIRS)
  MESSAGE(FATAL_ERROR
          "We did not find Embree installed on your system. OSPRay requires an"
          " Embree installation >= v${EMBREE_VERSION_REQUIRED}, please download"
          " and extract Embree or compile Embree from source, then set the"
          " 'embree_DIR' variable to where it is installed.")
ENDIF()

# Check for required Embree features  #######################################

OSPRAY_CHECK_EMBREE_FEATURE(ISPC_SUPPORT ISPC)
OSPRAY_CHECK_EMBREE_FEATURE(INTERSECTION_FILTER "intersection filter")
OSPRAY_CHECK_EMBREE_FEATURE(INTERSECTION_FILTER_RESTORE "intersection filter")
OSPRAY_CHECK_EMBREE_FEATURE(GEOMETRY_TRIANGLES "triangle geometries")
OSPRAY_CHECK_EMBREE_FEATURE(GEOMETRY_USER "user geometries")
OSPRAY_CHECK_EMBREE_FEATURE(RAY_PACKETS "ray packets")
OSPRAY_CHECK_EMBREE_FEATURE(BACKFACE_CULLING "backface culling" OFF)

# also remove Embree's TBB libs if OSPRay uses TBB to avoid problems with
# cyclic rpath
IF(NOT DEFINED EMBREE_LIBRARIES OR OSPRAY_TASKING_TBB)
  SET(EMBREE_LIBRARIES ${EMBREE_LIBRARY})
ELSE()
  # check if we need to add TBB to EMBREE_LIBRARIES
  IF((EMBREE_TASKING_TBB OR (${EMBREE_TASKING_SYSTEM} STREQUAL "TBB"))
      AND NOT EMBREE_USE_PACKAGED_TBB)
    OSPRAY_WARN_ONCE(EMBREE_FORCE_TBB
      "You *MUST* have TBB installed based on the Embree we found!")
    FIND_PACKAGE(TBB REQUIRED)
    SET(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} ${TBB_LIBRARIES})
  ENDIF()
ENDIF()

SET(EMBREE_ISA_SUPPORTS_SSE4   FALSE)
SET(EMBREE_ISA_SUPPORTS_AVX    FALSE)
SET(EMBREE_ISA_SUPPORTS_AVX2   FALSE)
SET(EMBREE_ISA_SUPPORTS_AVX512 FALSE)

IF (${EMBREE_MAX_ISA} STREQUAL "SSE4.1")
  SET(EMBREE_ISA_SUPPORTS_SSE4 TRUE)
ELSEIF (${EMBREE_MAX_ISA} STREQUAL "AVX")
  SET(EMBREE_ISA_SUPPORTS_SSE4 TRUE)
  SET(EMBREE_ISA_SUPPORTS_AVX  TRUE)
ELSEIF (${EMBREE_MAX_ISA} STREQUAL "AVX2")
  SET(EMBREE_ISA_SUPPORTS_SSE4 TRUE)
  SET(EMBREE_ISA_SUPPORTS_AVX  TRUE)
  SET(EMBREE_ISA_SUPPORTS_AVX2 TRUE)
ELSEIF (${EMBREE_MAX_ISA} STREQUAL "AVX512KNL")
  SET(EMBREE_ISA_SUPPORTS_SSE4   TRUE)
  SET(EMBREE_ISA_SUPPORTS_AVX    TRUE)
  SET(EMBREE_ISA_SUPPORTS_AVX2   TRUE)
  SET(EMBREE_ISA_SUPPORTS_AVX512 TRUE)
ENDIF()

IF(NOT EMBREE_ISA_SUPPORTS_SSE4)
    MESSAGE(FATAL_ERROR
            "Your Embree build needs to support at least SSE4.1!")
ENDIF()

# Configure OSPRay ISA last after we've detected what we got w/ Embree
OSPRAY_CONFIGURE_ISPC_ISA()
<commit_msg>Embree v2.14 will support individually enabled ISAs<commit_after>## ======================================================================== ##
## 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.                                           ##
## ======================================================================== ##

SET(EMBREE_VERSION_REQUIRED 2.13.0)

# Find existing Embree on the machine #######################################

FIND_PACKAGE(embree ${EMBREE_VERSION_REQUIRED} QUIET)
IF(NOT DEFINED EMBREE_INCLUDE_DIRS)
  MESSAGE(FATAL_ERROR
          "We did not find Embree installed on your system. OSPRay requires an"
          " Embree installation >= v${EMBREE_VERSION_REQUIRED}, please download"
          " and extract Embree or compile Embree from source, then set the"
          " 'embree_DIR' variable to where it is installed.")
ENDIF()

# Check for required Embree features  #######################################

OSPRAY_CHECK_EMBREE_FEATURE(ISPC_SUPPORT ISPC)
OSPRAY_CHECK_EMBREE_FEATURE(INTERSECTION_FILTER "intersection filter")
OSPRAY_CHECK_EMBREE_FEATURE(INTERSECTION_FILTER_RESTORE "intersection filter")
OSPRAY_CHECK_EMBREE_FEATURE(GEOMETRY_TRIANGLES "triangle geometries")
OSPRAY_CHECK_EMBREE_FEATURE(GEOMETRY_USER "user geometries")
OSPRAY_CHECK_EMBREE_FEATURE(RAY_PACKETS "ray packets")
OSPRAY_CHECK_EMBREE_FEATURE(BACKFACE_CULLING "backface culling" OFF)

# also remove Embree's TBB libs if OSPRay uses TBB to avoid problems with
# cyclic rpath
IF(NOT DEFINED EMBREE_LIBRARIES OR OSPRAY_TASKING_TBB)
  SET(EMBREE_LIBRARIES ${EMBREE_LIBRARY})
ELSE()
  # check if we need to add TBB to EMBREE_LIBRARIES
  IF((EMBREE_TASKING_TBB OR (${EMBREE_TASKING_SYSTEM} STREQUAL "TBB"))
      AND NOT EMBREE_USE_PACKAGED_TBB)
    OSPRAY_WARN_ONCE(EMBREE_FORCE_TBB
      "You *MUST* have TBB installed based on the Embree we found!")
    FIND_PACKAGE(TBB REQUIRED)
    SET(EMBREE_LIBRARIES ${EMBREE_LIBRARIES} ${TBB_LIBRARIES})
  ENDIF()
ENDIF()

IF (${EMBREE_MAX_ISA} STREQUAL "NONE")
  SET(EMBREE_ISA_SUPPORTS_SSE4   ${EMBREE_ISA_SSE42})
  SET(EMBREE_ISA_SUPPORTS_AVX    ${EMBREE_ISA_AVX})
  SET(EMBREE_ISA_SUPPORTS_AVX2   ${EMBREE_ISA_AVX2})
  SET(EMBREE_ISA_SUPPORTS_AVX512 ${EMBREE_ISA_AVX512KNL})
ELSE()
  SET(EMBREE_ISA_SUPPORTS_SSE4   FALSE)
  SET(EMBREE_ISA_SUPPORTS_AVX    FALSE)
  SET(EMBREE_ISA_SUPPORTS_AVX2   FALSE)
  SET(EMBREE_ISA_SUPPORTS_AVX512 FALSE)
  
  IF (${EMBREE_MAX_ISA} STREQUAL "SSE4.1")
    SET(EMBREE_ISA_SUPPORTS_SSE4 TRUE)
  ELSEIF (${EMBREE_MAX_ISA} STREQUAL "AVX")
    SET(EMBREE_ISA_SUPPORTS_SSE4 TRUE)
    SET(EMBREE_ISA_SUPPORTS_AVX  TRUE)
  ELSEIF (${EMBREE_MAX_ISA} STREQUAL "AVX2")
    SET(EMBREE_ISA_SUPPORTS_SSE4 TRUE)
    SET(EMBREE_ISA_SUPPORTS_AVX  TRUE)
    SET(EMBREE_ISA_SUPPORTS_AVX2 TRUE)
  ELSEIF (${EMBREE_MAX_ISA} STREQUAL "AVX512KNL")
    SET(EMBREE_ISA_SUPPORTS_SSE4   TRUE)
    SET(EMBREE_ISA_SUPPORTS_AVX    TRUE)
    SET(EMBREE_ISA_SUPPORTS_AVX2   TRUE)
    SET(EMBREE_ISA_SUPPORTS_AVX512 TRUE)
  ENDIF()
ENDIF()

IF(NOT EMBREE_ISA_SUPPORTS_SSE4)
    MESSAGE(FATAL_ERROR
            "Your Embree build needs to support at least SSE4.1!")
ENDIF()

# Configure OSPRay ISA last after we've detected what we got w/ Embree
OSPRAY_CONFIGURE_ISPC_ISA()

{'fraction_non_alphanumeric': 0.12749905695963787, 'fraction_numerical': 0.011567961775430655, 'mean_word_length': 3.3157894736842106, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 28, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '214734', 'n_tokens_mistral': 2728, 'n_tokens_neox': 2632, 'n_words': 600}