File: embree_info.cpp

package info (click to toggle)
embree 4.4.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 99,492 kB
  • sloc: cpp: 224,036; xml: 40,944; ansic: 2,731; python: 812; sh: 639; makefile: 228; csh: 42
file content (42 lines) | stat: -rw-r--r-- 981 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#if defined(EMBREE_SYCL_SUPPORT)
#include <sycl/sycl.hpp>
#endif
#include <embree4/rtcore.h>

#if defined(EMBREE_SYCL_SUPPORT)
#include "../common/sycl/util.h"
#endif

RTC_NAMESPACE_USE

int main() {

#if defined(EMBREE_SYCL_SUPPORT)
  try {
    embree::check_raytracing_support();
  } catch (std::exception& e) {
    std::cerr << e.what() << std::endl;
    return 1;
  }

  try {
    sycl::device sycl_device(rtcSYCLDeviceSelector);
    sycl::context sycl_context(sycl_device);
    RTCDevice device = rtcNewSYCLDevice(sycl_context, "verbose=1");
    embree::printAllSYCLDevices();
    rtcReleaseDevice(device);
  } catch (std::exception& e) {
    std::cerr << "Failed to create a SYCL Embree GPU device. Reason: " << e.what() << std::endl;
    embree::printAllSYCLDevices();
    return 1;
  }
#else
  RTCDevice device = rtcNewDevice("verbose=1");
  rtcReleaseDevice(device);
#endif
  
  return 0;
}