MCPcopy Create free account
hub / github.com/RenderKit/embree / initializeDevice

Function initializeDevice

tutorials/minimal/minimal_sycl.cpp:106–118  ·  view source on GitHub ↗

* Embree has a notion of devices, which are entities that can run * raytracing kernels. * We initialize our device here, and then register the error handler so that * we don't miss any errors. * * rtcNewDevice() takes a configuration string as an argument. See the API docs * for more information. * * Note that RTCDevice is reference-counted. */

Source from the content-addressed store, hash-verified

104 * Note that RTCDevice is reference-counted.
105 */
106RTCDevice initializeDevice(sycl::context& sycl_context, sycl::device& sycl_device)
107{
108 RTCDevice device = rtcNewSYCLDevice(sycl_context, "");
109 rtcSetDeviceSYCLDevice(device,sycl_device);
110
111 if (!device) {
112 printf("error %s: cannot create device. (reason: %s)\n", rtcGetErrorString(rtcGetDeviceError(NULL)), rtcGetDeviceLastErrorMessage(NULL));
113 exit(1);
114 }
115
116 rtcSetDeviceErrorFunction(device, errorFunction, NULL);
117 return device;
118}
119
120/*
121 * Create a scene, which is a collection of geometry objects. Scenes are

Callers 1

mainFunction · 0.70

Calls 6

rtcNewSYCLDeviceFunction · 0.85
rtcSetDeviceSYCLDeviceFunction · 0.85
rtcGetErrorStringFunction · 0.85
rtcGetDeviceErrorFunction · 0.85

Tested by

no test coverage detected