Reputation: 354
When I use a cpu_selector and a gpu_selector, these two devices fall into 2 different context by default? Why is that the default when having devices within same context helps with performant memory access of buffers (no overhead of copying over the data to a different context)?
Upvotes: 0
Views: 168
Reputation: 2244
The SYCL context can only encapsulate the devices from a single platform, and cannot be created using devices from two or more different platforms.
The devices which can be attached to the same context is platform dependant, not user-defined. You can construct a context for many devices from the same platform if the same platform reports them, but if they are on different platforms then you won't be able to.
If you want to understand the details you can read this section of the SYCL specification https://www.khronos.org/registry/SYCL/specs/sycl-1.2.1.pdf#page=54
Upvotes: 3