Skip to content

Commit f009757

Browse files
committed
Create extensions directory. Populate it with Ordered Queue and Unified Shared Memory (USM) proposals.
Signed-off-by: James Brodman <[email protected]>
1 parent e87838c commit f009757

File tree

5 files changed

+571
-0
lines changed

5 files changed

+571
-0
lines changed

sycl/doc/extensions/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Extensions
2+
3+
This is where documents can be found that propose extensions to the SYCL specification.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
= SYCL Proposals: Ordered Queue
2+
James Brodman <james[email protected]>
3+
v0.1
4+
:source-highlighter: pygments
5+
:icons: font
6+
== Introduction
7+
This document presents an addition proposed for a future version of the SYCL Specification. The goal of this proposal is to reduce the complexity and verbosity of using SYCL for programmers.
8+
9+
== Ordered Queue
10+
Queues in SYCL are out-of-order by default. SYCL constructs directed acyclic graphs to ensure tasks are properly ordered based on their data dependences. However, many programs only require linear DAGs. The overheads of constructing and managing DAGs are unnecessary for this class of program. The `ordered_queue` class exists to serve this class of programs by providing simple in-order semantics. `ordered_queue` otherwise functions identically to the normal SYCL `queue`. Due to the simpler semantics and task dependences of an in-order queue, additional programming simplifications are also possible.
11+
[source,cpp]
12+
----
13+
include::ordered_queue.h[]
14+
----
15+
16+
=== API Simplifications
17+
Since `ordered_queue` has simpler in-order semantics, programmers do not need to specify dependences between tasks by building DAGs based on data dependences. Command group scope for tasks submitted to `ordered_queue` only needs to contain kernel definitions or explicit memory operations in order to define valid execution. Consequently, the `single_task` and `parallel_for` APIs, normally used on the command group `handler` class, are available directly on the `ordered_queue` class.
18+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
namespace sycl {
2+
class ordered_queue {
3+
public:
4+
explicit ordered_queue(const property_list &propList = {});
5+
6+
ordered_queue(const async_handler &asyncHandler,
7+
const property_list &propList = {});
8+
9+
ordered_queue(const device_selector &deviceSelector,
10+
const property_list &propList = {});
11+
12+
ordered_queue(const device_selector &deviceSelector,
13+
const async_handler &asyncHandler, const property_list &propList = {});
14+
15+
ordered_queue(const device &syclDevice, const property_list &propList = {});
16+
17+
ordered_queue(const device &syclDevice, const async_handler &asyncHandler,
18+
const property_list &propList = {});
19+
20+
ordered_queue(const context &syclContext, const device_selector &deviceSelector,
21+
const property_list &propList = {});
22+
23+
ordered_queue(const context &syclContext, const device_selector &deviceSelector,
24+
const async_handler &asyncHandler, const property_list &propList = {});
25+
26+
ordered_queue(cl_command_queue clQueue, const context& syclContext,
27+
const async_handler &asyncHandler = {});
28+
29+
/* -- common interface members -- */
30+
31+
/* -- property interface members -- */
32+
33+
cl_command_queue get() const;
34+
35+
context get_context() const;
36+
37+
device get_device() const;
38+
39+
bool is_host() const;
40+
41+
template <info::queue param>
42+
typename info::param_traits<info::queue, param>::return_type get_info() const;
43+
44+
template <typename T>
45+
event submit(T cgf);
46+
47+
template <typename T>
48+
event submit(T cgf, const queue &secondaryQueue);
49+
50+
void wait();
51+
52+
void wait_and_throw();
53+
54+
void throw_asynchronous();
55+
56+
/* -- API simplifications -- */
57+
58+
template <typename KernelName, typename KernelType>
59+
event single_task(KernelType kernelFunc);
60+
61+
template <typename KernelName, typename KernelType, int dimensions>
62+
event parallel_for(range<dimensions> numWorkItems, kernelType kernelFunc);
63+
64+
template <typename KernelName, typename KernelType, int dimensions>
65+
event parallel_for(range<dimensions> numWorkItems,
66+
id<dimensions> workItemOffset, kernelType kernelFunc);
67+
68+
template <typename KernelName, typename KernelType, int dimensions>
69+
event parallel_for(nd_range<dimensions> executionRange, kernelType kernelFunc);
70+
71+
};
72+
} // namespace sycl
73+

sycl/doc/extensions/usm/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Unified Shared Memory
2+
3+
Unified Shared Memory - an extension to bring pointer-based programming to SYCL

0 commit comments

Comments
 (0)