You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SYCL][Doc] Update SYCL_INTEL_data_flow_pipes extension for FPGA host… (#8789)
A continuation of #5838. Accompanying runtime change is #7468.
Add a memory order parameter to device-side read/write members and
default to sycl::memory_order::seq_cst. This parameter is in place but
not being used at this moment, it's intended for the future work.
Add host pipe read/write members with additional sycl::queue parameter.
---------
Co-authored-by: Steffen Larsen <steffen.larsen@intel.com>
Copy file name to clipboardExpand all lines: sycl/doc/extensions/supported/sycl_ext_intel_dataflow_pipes.asciidoc
+86-8Lines changed: 86 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ This document describes an extension that adds pipes to SYCL. Pipes are first i
31
31
32
32
== Notice
33
33
34
-
Copyright (c) 2019-2021 Intel Corporation. All rights reserved.
34
+
Copyright (c) 2019-2023 Intel Corporation. All rights reserved.
35
35
36
36
== Status
37
37
@@ -49,10 +49,25 @@ Revision: 3
49
49
== Contact
50
50
Michael Kinsner, Intel (michael 'dot' kinsner 'at' intel 'dot' com)
51
51
52
+
== Contributors
53
+
54
+
Michael Kinsner, Intel +
55
+
Shuo Niu, Intel +
56
+
Bo Lei, Intel +
57
+
Marco Jacques, Intel +
58
+
Joe Garvey, Intel +
59
+
Aditi Kumaraswamy, Intel +
60
+
Robert Ho, Intel +
61
+
Sherry Yuan, Intel +
62
+
Peter Colberg, Intel +
63
+
Zibai Wang, Intel
64
+
52
65
== Dependencies
53
66
54
67
This extension is written against the SYCL 2020 specification, Revision 3.
55
68
69
+
It also depends on the `sycl_ext_oneapi_properties` extension.
70
+
56
71
The use of blocking pipe reads or writes requires support for https://github.com/KhronosGroup/SPIRV-Registry/blob/master/extensions/INTEL/SPV_INTEL_blocking_pipes.asciidoc[SPV_INTEL_blocking_pipes] if SPIR-V is used by an implementation.
@@ -644,15 +659,15 @@ Automated mechanisms are possible to provide uniquification across calls, and co
644
659
645
660
The Intel FPGA experimental `pipe` class is implemented in `sycl/ext/intel/experimental/pipes.hpp` which is included in `sycl/ext/intel/fpga_extensions.hpp`.
646
661
647
-
In the experimental API version, read/write methods take in a property list as function argument, which can contain the latency control properties `latency_anchor_id` and/or `latency_constraint`.
662
+
In the experimental API version, the device side read/write methods take in a property list as function argument, which can contain the latency control properties `latency_anchor_id` and/or `latency_constraint`.
648
663
649
664
* `sycl::ext::intel::experimental::latency_anchor_id<N>`, where `N` is an integer: An ID to associate with the current read/write function call, which can then be referenced by other `latency_constraint` properties elsewhere in the program to define relative latency constaints. ID must be unique within the application, and a diagnostic is required if that condition is not met.
650
665
* `sycl::ext::intel::experimental::latency_constraint<A, B, C>`: A tuple of three values which cause the current read/write function call to act as an endpoint of a latency constraint relative to a specified `latency_anchor_id` defined by a different instruction.
651
666
** `A` is an integer: The ID of the target anchor defined on a different instruction through a `latency_anchor_id` property.
652
667
** `B` is an enum value: The type of control from the set {`latency_control_type::exact`, `latency_control_type::max`, `latency_control_type::min`}.
653
668
** `C` is an integer: The relative clock cycle difference between the target anchor and the current function call, that the constraint should infer subject to the type of the control (exact, max, min).
If the read/write member functions of a pipe are called from the host side, a `sycl::queue` is added to the parameters. The `memory_order` parameter is also added to the parameters for future work.
using default_pipe_properties = decltype(sycl::ext::oneapi::experimental::properties(sycl::ext::intel::experimental::uses_valid<true>));
788
+
789
+
// Classes used to name the kernels
790
+
class TestTask;
791
+
class H2DPipeID;
792
+
class D2HPipeID;
793
+
794
+
using H2DPipe = sycl::ext::intel::experimental::pipe<H2DPipeID, int, 10, default_pipe_properties>;
795
+
using D2HPipe = sycl::ext::intel::experimental::pipe<D2HPipeID, int, 10, default_pipe_properties>;
796
+
797
+
struct BasicKernel {
798
+
void operator()() const {
799
+
auto a = H2DPipe::read();
800
+
D2HPipe::write(a+1);
801
+
}
802
+
};
803
+
804
+
int main() {
805
+
queue q(testconfig_selector{});
806
+
H2DPipe::write(q, 1);
807
+
808
+
q.submit([&](handler &h) {
809
+
h.single_task<TestTask>(BasicKernel{});
810
+
});
811
+
auto b = D2HPipe::read(q);
812
+
std::cout << b << std::endl; // It should print 2;
813
+
}
814
+
----
815
+
816
+
== Issues for experimental API
817
+
818
+
. Although the memory_order parameter hasn't been used in the implementation, the choice of seq_cst for the default value of the `sycl::memory_order` parameter of the read/write functions is still open for discussion. While seq_cst is more consistent with C++ atomics, it is a change from how pipes work today, which is equivalent to memory_order::relaxed. Another consideration is that SYCL 2020 atomic_ref uses a third approach where the default must be specified as a template parameter of the class itself.
819
+
+
820
+
--
821
+
*RESOLUTION*: Not resolved. Still under discussion.
822
+
--
823
+
824
+
== Future work
825
+
826
+
. In the future, the `sycl::memory_order` parameter of read/write functions will control how other memory accesses, including regular, non-atomic memory accesses, are to be ordered around the pipe read/write operation. The default memory order is `sycl::memory_order::seq_cst`. Currently, `sycl::memory_order` parameter is defined but not being used in the implementation.
827
+
751
828
== Feature test macro
752
829
753
830
This extension provides a feature-test macro as described in the core SYCL
@@ -776,6 +853,7 @@ extension's APIs the implementation supports.
0 commit comments