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
Copy file name to clipboardExpand all lines: DirectProgramming/C++SYCL_FPGA/Tutorials/Features/lsu_control/README.md
+15-11Lines changed: 15 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ This sample is an FPGA tutorial that demonstrates how to configure the load-stor
10
10
11
11
## Purpose
12
12
13
-
The compiler creates load-store units (LSU) to access off-chip data. The compiler has many options to choose from when configuring each LSU. The SYCL*-compliant LSU controls extension allows you to override the compiler's internal heuristics and control the architecture of each LSU. An introduction to the extension in this tutorial will explain the available options, extension defaults, appropriate use cases, and area trade-offs.
13
+
The compiler creates load-store units (LSU) to access memories, both on-chip and off-chip. The compiler has many options to choose from when configuring each LSU. The SYCL*-compliant LSU controls extension allows you to override the compiler's internal heuristics and control the architecture of individual LSUs that are used to access variable-latency off-chip memory. An introduction to the extension in this tutorial will explain the available options, extension defaults, appropriate use cases, and area trade-offs.
14
14
15
15
## Prerequisites
16
16
@@ -63,7 +63,7 @@ The sample illustrates the following important concepts.
63
63
64
64
### LSUs and LSU Styles
65
65
66
-
An LSU is a block that handles loading and storing data to and from memory. Off-chip memory can have variable latency. To mitigate this, different LSU implementations, referred to as styles, are available.
66
+
An LSU is a block that handles loading and storing data to and from memory. Off-chip memory can have variable latency. To mitigate this, different LSU styles are available.
67
67
68
68
The two LSU styles used in this tutorial are listed below:
69
69
@@ -77,11 +77,15 @@ The best LSU style depends on the memory access pattern in your design. There ar
77
77
78
78
In addition to these two styles, there are also LSU modifiers. LSU modifiers are add-ons that can be combined with LSU styles, such as caching, which can be combined with the burst-coalesced LSU style.
79
79
80
-
For more details on LSU modifiers and LSU styles, refer to the Memory Accesses section in the [FPGA Optimization Guide for Intel® oneAPI Toolkits Developer Guide](https://software.intel.com/content/www/us/en/develop/documentation/oneapi-fpga-optimization-guide).
80
+
For more details on LSU modifiers and LSU styles, refer to the *Memory Accesses* section in the [FPGA Optimization Guide for Intel® oneAPI Toolkits Developer Guide](https://www.intel.com/content/www/us/en/docs/oneapi-fpga-add-on/optimization-guide/current/memory-accesses.html).
81
81
82
82
### Introduction to the LSU Control Extension
83
83
84
-
The class: ```ext::intel::lsu``` enables you to control the architecture of the LSU. The class has two member functions, `load()` and `store()`, which allow loading from and storing to a global pointer.
84
+
The class: ```ext::intel::lsu``` enables you to control the architecture of the LSU. The class has two member functions, `load()` and `store()`, which allow loading from and storing to a global pointer (via `sycl::multi_ptr` rather than raw pointer).
85
+
86
+
There are two steps to use the LSU control extension to optimize LSU behaviour:
87
+
1. Get a `sycl::multi_ptr` representation of the memory you wish to access using the `get_multi_ptr<>()` function.
88
+
2. Access this `sycl::multi_ptr` using one of the LSU control functions.
85
89
86
90
The table below summarizes the LSU control extension parameters. The parameters will be respected to the extent possible.
87
91
@@ -97,17 +101,17 @@ If the default options are used, a pipelined LSU is implemented.
97
101
#### Example: Controlling the `prefetch` and `statically_coalesce` Parameters
98
102
99
103
```c++
100
-
//Creating typedefs using the LSU controls class
101
-
//for each combination of LSU options desired.
104
+
//Creating typedefs using the LSU controls class
105
+
//for each combination of LSU options desired.
102
106
using PrefetchingLSU = ext::intel::lsu<ext::intel::prefetch<true>,
103
-
ext::intel::statically_coalesce<false>>;
107
+
ext::intel::statically_coalesce<false>>;
104
108
// ...
105
109
q.submit([&](handler &h) {
106
110
h.single_task<Kernel>([=] {
107
-
//Pointer to external memory
108
-
auto input_ptr = input_accessor.get_pointer();
111
+
//Pointer to external memory
112
+
auto input_ptr = input_accessor.template get_multi_ptr<access::decorated::no>();
109
113
110
-
//Compiler will use a Prefetch LSU for this load
114
+
//Compiler will use a Prefetch LSU for this load
111
115
int in_data = PrefetchingLSU::load(input_ptr);
112
116
113
117
//...
@@ -116,7 +120,7 @@ q.submit([&](handler &h) {
116
120
```
117
121
118
122
Currently, not every combination of parameters is valid in the compiler.
119
-
For more details on the descriptions of LSU controls, styles, and modifiers refer to the *FPGA LSU Controls* section in the [FPGA Optimization Guide for Intel® oneAPI Toolkits Developer Guide](https://software.intel.com/content/www/us/en/develop/documentation/oneapi-fpga-optimization-guide).
123
+
For more details on the descriptions of LSU controls, styles, and modifiers refer to the *Load-Store Unit Controls* section in the [FPGA Optimization Guide for Intel® oneAPI Toolkits Developer Guide](https://www.intel.com/content/www/us/en/docs/oneapi-fpga-add-on/optimization-guide/current/load-store-unit-controls.html).
0 commit comments