SYCL, unlike OpenCL, provides a programming model in which the user doesn't need to manage dependencies between kernels and memory explicitly. More...
Classes | |
class | sycl::_V1::detail::Command |
The Command class represents some action that needs to be performed on one or more memory objects. More... | |
struct | sycl::_V1::detail::MemObjRecord |
Memory Object Record. More... | |
class | sycl::_V1::detail::Scheduler |
DPC++ graph scheduler class. More... | |
class | sycl::_V1::detail::Scheduler::GraphBuilder |
Graph builder class. More... | |
class | sycl::_V1::detail::Scheduler::GraphProcessor |
Graph Processor provides interfaces for enqueueing commands and their dependencies to the underlying runtime. More... | |
SYCL, unlike OpenCL, provides a programming model in which the user doesn't need to manage dependencies between kernels and memory explicitly.
The DPC++ Runtime must ensure correct execution with respect to the order commands are submitted.
This document describes the part of the DPC++ Runtime that is responsible for building and processing dependency graph.
The SYCL framework defines command group (CG) as an entity that represents minimal execution block. The command group is submitted to SYCL queue and consists of a kernel or an explicit memory operation, and their requirements. The SYCL queue defines the device and context using which the kernel should be executed.
The commands that contain explicit memory operations include copy, fill, update_host and other operations. It's up to implementation how to define these operations.
The relative order of command groups submission defines the order in which kernels must be executed if their memory requirements intersect. For example, if a command group A writes to a buffer X, command group B reads from X, then the scheduled execution order of A and B will be the same as their dynamic submission order (matches program order if submitted from the same host thread).
Memory requirements are requests to SYCL memory objects, such as buffer and image. SYCL memory objects are not bound to any specific context or device, it's SYCL responsibility to allocate and/or copy memory to the target context to achieve correct execution.
Refer to SYCL Specification 1.2.1 sections 3.4 and 3.5 to find more information about SYCL execution and memory model.
In the example above the DPC++ RT does the following:
So, the example above will be converted to the following OpenCL pseudo code