### Linux SYCL Environment Setup Source: https://github.com/renderkit/embree/blob/master/tutorials/README.md Sources the startup script for the DPC++ compiler to configure the environment for SYCL compilation on Linux. ```Bash source dpcpp_compiler/startup.sh ``` -------------------------------- ### Linux Embree Environment Setup Source: https://github.com/renderkit/embree/blob/master/doc/src/install.md Commands to unpack the Embree tarball and source the environment script for Linux. ```bash tar xzf embree-.x86_64.linux.tar.gz source embree-.x86_64.linux/embree-vars.sh ``` -------------------------------- ### Compile Embree Project Source: https://github.com/renderkit/embree/blob/master/doc/src/renderer.md Instructions to configure, generate Makefiles, and compile the Embree project. Assumes Embree is installed or configured manually. ```bash c # Configure g # Generate Makefiles make # Compile ``` -------------------------------- ### CMake Command Line for Embree Source: https://github.com/renderkit/embree/blob/master/doc/src/install.md Example command line to configure a CMake build, specifying paths for Embree and TBB. ```bash cmake -D embree_DIR=path_to_embree_package/lib/cmake/embree-/ \ -D TBB_DIR=path_to_tbb_package/lib/cmake/tbb/ \ .. ``` -------------------------------- ### CMake Configuration for Embree Source: https://github.com/renderkit/embree/blob/master/doc/src/install.md Example CMakeLists.txt configuration to find and link the Embree library, including setting directory variables. ```cmake FIND_PACKAGE(embree REQUIRED) TARGET_LINK_LIBRARIES(application embree) ``` -------------------------------- ### Get Embree Example Renderer Sources Source: https://github.com/renderkit/embree/blob/master/doc/src/renderer.md Instructions on how to download the Embree Example Renderer source code using git, including checking out a specific version. ```bash git clone https://github.com/embree/embree-renderer.git embree-renderer cd embree-renderer git checkout v2.3.2 ``` -------------------------------- ### Embree Tutorial Setup (CMake) Source: https://github.com/renderkit/embree/blob/master/tutorials/forest/CMakeLists.txt Configures and builds Embree tutorials, including the geometry instance array example, with options for ISPC and SYCL compilation. ```cmake IF (EMBREE_GEOMETRY_INSTANCE_ARRAY) INCLUDE(tutorial) ADD_TUTORIAL(forest) ADD_TUTORIAL_ISPC(forest) ADD_TUTORIAL_SYCL(forest) ADD_EMBREE_TEST_ECS(forest embree_forest ARGS --frames 4) ENDIF() ``` -------------------------------- ### Build Embree BVH Access Example Source: https://github.com/renderkit/embree/blob/master/tutorials/bvh_access/CMakeLists.txt Configures and builds the embree_bvh_access executable using CMake. This includes defining the executable, linking necessary libraries (embree, math, sys, tasking, tutorial), setting installation properties, and signing the target. ```CMake IF (EMBREE_GEOMETRY_CURVE) ADD_EXECUTABLE(embree_bvh_access ../../kernels/embree.rc bvh_access.cpp) TARGET_LINK_LIBRARIES(embree_bvh_access embree math sys tasking tutorial) SET_PROPERTY(TARGET embree_bvh_access PROPERTY FOLDER tutorials/single) SET_PROPERTY(TARGET embree_bvh_access APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") INSTALL(TARGETS embree_bvh_access DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT examples) SIGN_TARGET(embree_bvh_access) ENDIF() ADD_EMBREE_TEST_ECS(bvh_access embree_bvh_access NO_REFERENCE NO_ISPC NO_SYCL) ``` -------------------------------- ### Embree Network Mode Source: https://github.com/renderkit/embree/blob/master/doc/src/renderer.md Instructions for using Embree in network mode, including starting the render server and connecting from a client machine. ```bash renderer_server renderer -connect ip_of_render_server -c ../../models/cornell_box.ecs ``` -------------------------------- ### Embree Tutorial Setup Source: https://github.com/renderkit/embree/blob/master/tutorials/intersection_filter/CMakeLists.txt Includes directives for setting up the Embree tutorial, specifically for the intersection filter example. It conditionally includes tutorial logic and adds the tutorial for different backends. ```CMake IF (EMBREE_FILTER_FUNCTION) INCLUDE(tutorial) ADD_TUTORIAL(intersection_filter) ADD_TUTORIAL_ISPC(intersection_filter) ADD_TUTORIAL_SYCL(intersection_filter) ENDIF() ADD_EMBREE_TEST_ECS(intersection_filter embree_intersection_filter) ``` -------------------------------- ### macOS Embree Environment Setup Source: https://github.com/renderkit/embree/blob/master/doc/src/install.md Commands to unpack the Embree zip file and source the environment script for macOS. ```bash unzip embree-.x64.macosx.zip source embree-.x64.macosx/embree-vars.sh ``` -------------------------------- ### Windows SYCL Environment Setup Source: https://github.com/renderkit/embree/blob/master/tutorials/README.md Configures the environment variables on Windows to use the DPC++ compiler and include paths for Embree and TBB. ```Bash set "DPCPP_DIR=path_to_dpcpp_compiler" set "PATH=%DPCPP_DIR%\bin;%PATH%" set "PATH=%DPCPP_DIR%\lib;%PATH%" set "CPATH=%DPCPP_DIR%\include;%CPATH%" set "INCLUDE=%DPCPP_DIR%\include;%INCLUDE%" set "LIB=%DPCPP_DIR%\lib;%LIB%" ``` -------------------------------- ### Compile Embree Example Renderer on Windows Source: https://github.com/renderkit/embree/blob/master/doc/src/renderer.md Steps for compiling the Embree Example Renderer on Windows using Visual Studio. This includes setting environment variables, selecting compilers, and configuring build options for instruction sets like AVX and AVX2. ```bash # Set EMBREE_INSTALL_DIR environment variable to the Embree root folder. # Use Visual Studio 2008 or 2010 solution file to compile. # Select 'ReleaseAVX' or 'ReleaseAVX2' for AVX/AVX2 support. # To compile without Intel ISPC, delete the device_ispc project from the solution. ``` -------------------------------- ### Listing AOT Supported Devices Source: https://github.com/renderkit/embree/blob/master/doc/src/install.md Command to list all devices supported by Ahead-Of-Time (AOT) compilation using the ocloc tool. ```Shell ocloc compile --help ``` -------------------------------- ### CMake Build Options for Embree Example Renderer Source: https://github.com/renderkit/embree/blob/master/doc/src/renderer.md Description of CMake build options available for the Embree Example Renderer, detailing the purpose of each option for configuring the build. ```APIDOC Option Description ---------------------------------- ----------------------------------- BUILD_SINGLE_RAY_DEVICE Single ray rendering device for CPUs. BUILD_SINGLE_RAY_DEVICE_XEON_PHI Single ray rendering device for the Intel® Xeon Phi™ coprocessor. BUILD_ISPC_DEVICE Intel® ISPC CPU rendering device operating on ray packets of size 4 (SSE) or 8 (AVX). BUILD_ISPC_DEVICE_XEON_PHI Intel® ISPC Xeon Phi rendering device operating on ray packets of size 16. BUILD_NETWORK_DEVICE Network device to render on render server. ``` -------------------------------- ### Compile Embree Example Renderer on Linux/macOS Source: https://github.com/renderkit/embree/blob/master/doc/src/renderer.md Instructions for compiling the Embree Example Renderer on Linux and macOS using CMake. This involves creating a build directory, configuring options via ccmake, and selecting build modes and compilers. ```bash mkdir build cd build ccmake .. # Configure build mode to 'Release' and select compiler (GCC, CLANG, ICC). # Enable desired build options like BUILD_SINGLE_RAY_DEVICE, BUILD_ISPC_DEVICE, etc. # Ensure target ISAs match Embree kernel compilation. ``` -------------------------------- ### Embree Convert Executable Build and Install (CMake) Source: https://github.com/renderkit/embree/blob/master/tutorials/convert/CMakeLists.txt This snippet shows the CMake commands used to build and install the embree_convert executable. It includes adding the executable with its source files, linking necessary libraries, setting target properties like folder and compile flags, installing the executable, and signing the target. ```cmake ADD_EXECUTABLE(embree_convert ../../kernels/embree.rc convert.cpp distribution1d.cpp distribution2d.cpp) TARGET_LINK_LIBRARIES(embree_convert scenegraph image tasking) SET_PROPERTY(TARGET embree_convert PROPERTY FOLDER tutorials/single) SET_PROPERTY(TARGET embree_convert APPEND PROPERTY COMPILE_FLAGS " ${FLAGS_LOWEST}") INSTALL(TARGETS embree_convert DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT examples) SIGN_TARGET(embree_convert) ``` -------------------------------- ### Windows Installation Source: https://github.com/renderkit/embree/blob/master/README.md Provides instructions for installing Embree on Windows by downloading a pre-built ZIP archive and setting the PATH environment variable. ```bash A pre-built version of Embree for Windows is provided as a ZIP archive [embree-4.4.0.x64.windows.zip](https://github.com/embree/embree/releases/download/v4.4.0/embree-4.4.0.x64.windows.zip). After unpacking this ZIP file, you should set the path to the `lib` folder manually to your `PATH` environment variable for applications to find Embree. ``` -------------------------------- ### Embree Tutorial Command Line Options Source: https://github.com/renderkit/embree/blob/master/doc/src/tutorials.md Embree tutorials support command-line parameters for customization. Options include setting camera parameters (`--vp`, `--vi`, `--vu`, `--fov`), window size (`--size`), fullscreen mode (`--fullscreen`), and RTCORE initialization strings (`--rtcore`). ```APIDOC Usage Example: ./triangle_geometry --vp 10 10 10 --vi 0 0 0 --size 1024 1024 --rtcore verbose=2,threads=1 Camera Parameters: --vp : Camera position --vi : Camera look-at point --vu : Camera up vector --fov : Vertical field of view Display Options: --size : Initial window size --fullscreen: Start in fullscreen mode RTCORE Options: --rtcore : Initialization string for Embree device (e.g., "verbose=2,threads=1") Help: --help: Print available command line options ``` -------------------------------- ### Embree Tutorial Command Line Arguments Source: https://github.com/renderkit/embree/blob/master/README.md Demonstrates common command-line arguments for Embree tutorials, including camera positioning, field of view, window size, fullscreen mode, and RTCore initialization. ```APIDOC Tutorial Command Line Options: --vp : Set initial camera position. --vi : Set initial camera look-at point. --vu : Set initial camera up vector. --fov : Set vertical field of view. --size : Set window size. --fullscreen: Start in fullscreen mode. --rtcore : Pass initialization string to Embree device (e.g., verbose=2,threads=1). ``` -------------------------------- ### Minimal Embree Tutorial Source: https://github.com/renderkit/embree/blob/master/README.md Describes the minimal Embree tutorial, designed for new users, which demonstrates basic device and scene initialization and ray intersection without image output. ```C++ // Source Code: https://github.com/embree/embree/blob/master/tutorials/minimal/minimal.cpp // This tutorial demonstrates: // - Initializing an Embree device (rtcNewDevice) // - Creating a scene (rtcNewScene) // - Intersecting rays with the scene (e.g., rtcIntersect1) ``` -------------------------------- ### Embree Minimal Tutorial Source: https://github.com/renderkit/embree/blob/master/doc/src/tutorials.md A basic tutorial for new Embree users, demonstrating device initialization and ray intersection. It can be compiled as C or C++ and focuses on core Embree functionalities without image output. ```C++ tutorials/minimal/minimal.cpp ``` -------------------------------- ### Embree CMake Configuration Source: https://github.com/renderkit/embree/blob/master/scripts/ospray/CMakeLists.txt Configures the build for Embree using CMake, specifying compiler, installation paths, build type, and disabling documentation, examples, and tests. ```cmake ExternalProject_Add(embree PREFIX embree URL "https://github.com/embree/embree/archive/v3.13.1.tar.gz" DOWNLOAD_NO_PROGRESS ON GIT_SUBMODULES "" STAMP_DIR embree/stamp BINARY_DIR embree/build LIST_SEPARATOR | CMAKE_ARGS -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_INSTALL_PREFIX:PATH=${COMPONENT_PATH} -DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR} -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} -DCMAKE_INSTALL_DOCDIR=${CMAKE_INSTALL_DOCDIR} -DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR} -DGLFW_BUILD_DOCS=OFF -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF BUILD_COMMAND ${DEFAULT_BUILD_COMMAND} BUILD_ALWAYS ${ALWAYS_REBUILD} ) ``` -------------------------------- ### Building Embree Tests Source: https://github.com/renderkit/embree/blob/master/doc/src/install.md Steps to extract and build the Embree testing package. This involves unzipping the testing archive and using CMake to configure and build the tests. ```Shell tar -xzf embree--testing.zip -C /path/to/installed/embree cd /path/to/installed/embree/testing cmake -B build cmake --build build target=tests ``` -------------------------------- ### Linux CMake Configuration for Embree Tutorials Source: https://github.com/renderkit/embree/blob/master/tutorials/README.md Configures the CMake build for Embree tutorials on Linux, specifying the compiler, build type, and paths to Embree and TBB installations. ```CMake cmake -D CMAKE_BUILD_TYPE=Release \ -D CMAKE_CXX_COMPILER=clang++ \ -D CMAKE_C_COMPILER=clang \ -D embree_DIR=`pwd`/../../../lib/cmake/embree-4.4.0/ \ -D TBB_DIR=path_to_tbb/oneapi-tbb-2021.2.0/lib/cmake/tbb/ .. cmake --build . ``` -------------------------------- ### Windows CMake Configuration for Embree Tutorials Source: https://github.com/renderkit/embree/blob/master/tutorials/README.md Configures the CMake build for Embree tutorials on Windows, specifying the compiler, build type, and paths to Embree and TBB installations. ```CMake cmake -G Ninja \ -D CMAKE_CXX_COMPILER=clang++ \ -D CMAKE_C_COMPILER=clang \ -D CMAKE_BUILD_TYPE=Release \ -D embree_DIR=%cd%\..\..\..\lib\cmake\embree-4.4.0\ \ -D TBB_DIR=path_to_tbb\oneapi-tbb-2021.2.0\lib\cmake\tbb .. cmake --build . ``` -------------------------------- ### Embree Viewer Tutorial Source: https://github.com/renderkit/embree/blob/master/doc/src/tutorials.md A simple OBJ viewer tutorial for Embree that traces primary visibility rays. It creates a scene with multiple meshes sharing index and vertex buffers and demonstrates support for per-vertex data like shading normals. Requires an OBJ file as a command-line argument. ```cpp #include #include // ... (rest of the viewer_device.cpp code) int main(int argc, char** argv) { // ... if (argc < 2) { std::cerr << "Usage: " << argv[0] << " -i " << std::endl; return 1; } // ... } ``` -------------------------------- ### Embree Tutorial Integration Source: https://github.com/renderkit/embree/blob/master/tutorials/next_hit/CMakeLists.txt Includes the tutorial script and adds the 'next_hit' tutorial for both standard and SYCL builds. ```CMake INCLUDE(tutorial) ADD_TUTORIAL(next_hit) ADD_TUTORIAL_SYCL(next_hit) ``` -------------------------------- ### Embree Path Tracer Tutorial Source: https://github.com/renderkit/embree/blob/master/doc/src/tutorials.md A simple path tracer tutorial based on the viewer tutorial. Requires an OBJ file and light source specified at the command line. Demonstrates rendering of complex models like the Austrian Imperial Crown and Asian Dragon. ```C++ /* * Copyright 2014 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 "tutorial/common/tutorial.h" #include #include RTC_NAMESPACE_BEGIN struct TutorialData { TutorialData(RTCDevice device, const char* scene_file) : tutorial(device, scene_file) {} Tutorial tutorial; }; static void error_handler(void* user_data, enum RTCError error, const char* str) { TutorialData* data = (TutorialData*)user_data; if (error == RTC_NO_ERROR) return; // // print error message // std::cerr << "Error: " << str << std::endl; // // abort execution // exit(1); } extern "C" { void embree_pathtracer_device(const char* scene_file) { RTCDevice device = rtcNewDevice(NULL); if (device == NULL) { std::cerr << "Failed to create device" << std::endl; return; } TutorialData* data = new TutorialData(device, scene_file); rtcAttachUserData(device, RTC_USER_DATA_TRACE_TYPE_INTERSECT, data); rtcSetUserData(device, RTC_USER_DATA_TRACE_TYPE_INTERSECT, data); rtcSetErrorFunction(device, error_handler, data); // render scene data->tutorial.render(); // cleanup delete data; rtcReleaseDevice(device); } } RTC_NAMESPACE_END ``` -------------------------------- ### Embree SYCL JIT Compilation Flags Source: https://github.com/renderkit/embree/blob/master/doc/src/install.md Compiler and linker flags for enabling Just-In-Time (JIT) compilation of Embree SYCL applications. These options ensure SYCL two-phase compilation, function pointer support, and JIT compilation. ```C++ # Compile options: -fsycl -Xclang -fsycl-allow-func-ptr -fsycl-targets=spir64 # Link options: -fsycl -fsycl-targets=spir64 ``` -------------------------------- ### Embree SYCL AOT Compilation Flags Source: https://github.com/renderkit/embree/blob/master/doc/src/install.md Compiler and linker flags for enabling Ahead-Of-Time (AOT) compilation of Embree SYCL applications, specifically targeting Xe HPG devices. This method precompiles device binaries for faster startup. ```C++ # Compile options: -fsycl -Xclang -fsycl-allow-func-ptr -fsycl-targets=spir64_gen # Link options: -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen "-device XE_HPG_CORE" ``` -------------------------------- ### Select Embree Renderer Device Source: https://github.com/renderkit/embree/blob/master/doc/src/renderer.md Commands to specify the rendering device (e.g., singleray, ispc, Xeon Phi) for the Embree renderer. ```bash ./renderer -device singleray -c ../models/cornell_box.ecs ./renderer -device ispc -c ../models/cornell_box.ecs ./renderer -device singleray_xeonphi -c ../../models/cornell_box.ecs ./renderer -device ispc_xeonphi -c ../../models/cornell_box.ecs ``` -------------------------------- ### CMake Install Test Files Source: https://github.com/renderkit/embree/blob/master/tests/CMakeLists.txt Configures the installation of test files and CMake scripts for the Embree project. It specifies the destination directory and component for installation, ensuring that testing infrastructure is available in the installed package. ```cmake INSTALL(FILES "${f}" DESTINATION "${CMAKE_INSTALL_TESTDIR}" COMPONENT testing) endforeach() # generated file adding tests INSTALL(FILES "${EMBREE_INSTALL_CTESTTESTFILE}" DESTINATION "${CMAKE_INSTALL_TESTDIR}" COMPONENT testing) # needed for adding tests in install destination INSTALL(FILES "${PROJECT_SOURCE_DIR}/common/cmake/test.cmake" DESTINATION "${CMAKE_INSTALL_TESTDIR}" COMPONENT testing) ``` -------------------------------- ### Embree Quaternion Motion Blur Tutorial Setup Source: https://github.com/renderkit/embree/blob/master/tutorials/quaternion_motion_blur/CMakeLists.txt Configures the Embree quaternion motion blur tutorial. It conditionally includes tutorial setup if EMBREE_GEOMETRY_USER is defined and adds the tutorial for different backends (standard, ISPC, SYCL). ```CMake IF (EMBREE_GEOMETRY_USER) INCLUDE(tutorial) ADD_TUTORIAL(quaternion_motion_blur) ADD_TUTORIAL_ISPC(quaternion_motion_blur) ADD_TUTORIAL_SYCL(quaternion_motion_blur) ENDIF() ADD_EMBREE_TEST_ECS(quaternion_motion_blur embree_quaternion_motion_blur) ``` -------------------------------- ### Install Embree with vcpkg Source: https://github.com/renderkit/embree/blob/master/doc/src/compilation.md Installs the Embree library using the vcpkg package manager. This involves cloning the vcpkg repository, bootstrapping it, integrating it with the system, and then installing the embree3 package. ```bash git clone https://github.com/Microsoft/vcpkg.git cd vcpkg ./bootstrap-vcpkg.sh ./vcpkg integrate install ./vcpkg install embree3 ``` -------------------------------- ### Embree Ray Mask Tutorial Setup Source: https://github.com/renderkit/embree/blob/master/tutorials/ray_mask/CMakeLists.txt Configures and builds the Embree ray mask tutorial. It includes conditional compilation based on EMBREE_RAY_MASK and adds tutorials for different backends. ```CMake IF (EMBREE_RAY_MASK) INCLUDE(tutorial) ADD_TUTORIAL(ray_mask) ADD_TUTORIAL_ISPC(ray_mask) ADD_TUTORIAL_SYCL(ray_mask) ENDIF() ADD_EMBREE_TEST_ECS(ray_mask embree_ray_mask ARGS --frames 128) ``` -------------------------------- ### Install Embree with vcpkg Source: https://github.com/renderkit/embree/blob/master/README.md Installs the Embree library using the vcpkg package manager. This involves cloning the vcpkg repository, bootstrapping it, integrating it with the system, and then installing the embree3 package. ```bash git clone https://github.com/Microsoft/vcpkg.git cd vcpkg ./bootstrap-vcpkg.sh ./vcpkg integrate install ./vcpkg install embree3 ``` -------------------------------- ### TBB Download and Installation Source: https://github.com/renderkit/embree/blob/master/scripts/ospray/CMakeLists.txt Determines the download URL for Intel Threading Building Blocks (TBB) based on the operating system and uses ExternalProject_Add to download and install it. The installation command copies the TBB directory to the component path. ```cmake if (APPLE) set(TBB_URL "http://github.com/intel/tbb/releases/download/v${TBB_VERSION}/oneapi-tbb-${TBB_VERSION}-mac.tgz") elseif (WIN32) set(TBB_URL "http://github.com/intel/tbb/releases/download/v${TBB_VERSION}/oneapi-tbb-${TBB_VERSION}-win.zip") else() set(TBB_URL "http://github.com/intel/tbb/releases/download/v${TBB_VERSION}/oneapi-tbb-${TBB_VERSION}-lin.tgz") endif() ExternalProject_Add(tbb PREFIX tbb DOWNLOAD_DIR tbb STAMP_DIR tbb/stamp SOURCE_DIR tbb/src BINARY_DIR tbb URL ${TBB_URL} DOWNLOAD_NO_PROGRESS ON CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "${CMAKE_COMMAND}" -E copy_directory ${COMPONENT_PATH} BUILD_ALWAYS OFF ) set(TBB_PATH "${COMPONENT_PATH}") ``` -------------------------------- ### Embree Tutorial Setup (CMake) Source: https://github.com/renderkit/embree/blob/master/tutorials/dynamic_scene/CMakeLists.txt Configures the Embree build system to include and build the dynamic scene tutorial. This involves adding the tutorial module and then specifically adding the dynamic scene tutorial with its various backends. ```C++ INCLUDE(tutorial) ADD_TUTORIAL(dynamic_scene) ADD_TUTORIAL_ISPC(dynamic_scene) ADD_TUTORIAL_SYCL(dynamic_scene) ADD_EMBREE_TEST_ECS(dynamic_scene embree_dynamic_scene) ``` -------------------------------- ### Install Embree Source: https://github.com/renderkit/embree/blob/master/doc/src/compilation.md Installs the compiled Embree library and header files to the system, typically to /usr. ```Shell sudo make install ``` -------------------------------- ### Embree User Geometry Tutorial Setup Source: https://github.com/renderkit/embree/blob/master/tutorials/user_geometry/CMakeLists.txt Configures the Embree user geometry tutorial. It conditionally includes the tutorial based on the EMBREE_GEOMETRY_USER flag, adds the tutorial for standard, ISPC, and SYCL builds, and includes an end-to-end test for user geometry. ```CMake IF (EMBREE_GEOMETRY_USER) INCLUDE(tutorial) ADD_TUTORIAL(user_geometry) ADD_TUTORIAL_ISPC(user_geometry) ADD_TUTORIAL_SYCL(user_geometry) ENDIF() ADD_EMBREE_TEST_ECS(user_geometry embree_user_geometry) ``` -------------------------------- ### Install Embree Static Library (CMake) Source: https://github.com/renderkit/embree/blob/master/kernels/level_zero/CMakeLists.txt Conditionally installs the 'ze_wrapper' static library and its CMake export targets if EMBREE_STATIC_LIB is defined. The installation paths are specified using standard CMake variables for libraries and export directories. ```cmake IF (EMBREE_STATIC_LIB) INSTALL(TARGETS ze_wrapper EXPORT ze_wrapper-targets ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT devel) INSTALL(EXPORT ze_wrapper-targets DESTINATION "${EMBREE_CMAKEEXPORT_DIR}" COMPONENT devel) ENDIF() ``` -------------------------------- ### Embree SYCL Initialization and Device Selection Source: https://github.com/renderkit/embree/blob/master/doc/src/api.md Demonstrates how to initialize an Embree SYCL device and select a SYCL device. It includes checking for SYCL device support and setting up a SYCL queue and context. ```SYCL #include #include // Exception handler for SYCL queue auto exception_handler = [](sycl::exception_list exceptions) { for (std::exception_ptr const& exc_ptr : exceptions) { try { std::rethrow_exception(exc_ptr); } catch (sycl::exception const& e) { std::cerr << "SYCL exception caught: " << e.what() << std::endl; } } }; // Check if SYCL device is supported by Embree // bool supported = rtcIsSYCLDeviceSupported(device); // Select the first SYCL device supported by Embree sycl::device device(rtcSYCLDeviceSelector); sycl::queue queue(device, exception_handler); sycl::context context(device); // Initialize Embree SYCL device RTCDevice rtcd_device = rtcNewSYCLDevice(context, ""); ```