rtcNewSYCLDevice(3)

πŸ’– rtcNewSYCLDevice β€” Embree Ray Tracing Kernels 4 πŸ’–

okay bestie, buckle up, because this one is literally the glow-up your GPU rendering era has been waiting for ✨


🌸 NAME 🌸

rtcNewSYCLDevice β€” makes you a shiny new device that's built for SYCL, no cap πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

#include <embree4/rtcore.h>

RTCDevice rtcNewSYCLDevice(sycl::context context, const char* config);

πŸ‘‘ DESCRIPTION πŸ‘‘

So this function? It creates a brand-new device for you to use with SYCL for GPU rendering, and it hands you back a handle to that device. Periodt. πŸ’…

The device object is reference counted, and its initial reference count is 1. When you're done with it, you release the handle with the rtcReleaseDevice API call. That's the whole breakup arc, clean and drama-free πŸ’”

The SYCL context you pass in (the context argument) is what gets used to allocate GPU data. So lowkey, only devices that live inside this context can be used for rendering. By default, the GPU data gets allocated on the first GPU device of the context β€” but bestie, you can change that whole vibe with the rtcSetDeviceSYCLDevice function 🫢

The device object is basically a class factory for all the other object types. Everything you create from the device β€” scenes, geometries, etc. β€” holds a reference back to the device. So the device will not get destroyed unless all those objects get destroyed first. It's giving very much main character energy with a whole entourage πŸ‘‘

And okay, this part matters: objects are only compatible if they belong to the same device. You cannot create a geometry in one device and attach it to a scene created with a different device. Not allowed. Not the move. πŸ™ˆ

For a full overview of the configurations you can pass in (that's the config argument), go peek at the rtcNewDevice function description. It's all there, iykyk πŸ’œ


πŸ’€ EXIT STATUS πŸ’€

  • On success? You get a handle to the created device. Slay. πŸ”₯
  • On failure? You get NULL as the device, and it sets a per-thread error code that you can query using rtcGetDeviceError(NULL). Yes bestie, you gotta check. Don't just ignore the error, that's not cute 😭

🌈 SEE ALSO 🌈

  • rtcRetainDevice
  • rtcReleaseDevice
  • rtcNewDevice

and that's the whole page, bestie! this one's from Embree Ray Tracing Kernels 4, dated with all the rtcNewSYCLDevice(3) energy. go forth, allocate your GPU data, and stay iconic πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…

πŸ“¦ where this page comes from