Skip to content

Commit e83a81d

Browse files
authored
Updating all tutorials that require USM support with error messages in (oneapi-src#648)
CMakeLists.txt if they select a board without USM support. Also added a method to override this check for custom boards. Added clearler instructions in the READMEs of these designs on the limitations to USM and how to override the check for custom BSPs.
1 parent 4b64c19 commit e83a81d

File tree

6 files changed

+58
-16
lines changed

6 files changed

+58
-16
lines changed

DirectProgramming/DPC++FPGA/Tutorials/DesignPatterns/buffered_host_streaming/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The [oneAPI Programming Guide](https://software.intel.com/en-us/oneapi-programmi
1313
| What you will learn | How to optimally stream data between the host and device to maximize throughput
1414
| Time to complete | 45 minutes
1515

16-
_Notice: SYCL USM host allocations (and therefore this tutorial) are only supported for the Intel® FPGA PAC D5005 (with Intel Stratix® 10 SX)_
16+
*Notice: SYCL USM host allocations (and therefore this tutorial) are only supported for the Intel&reg; FPGA PAC D5005 (with Intel Stratix&reg; 10 SX) with USM support (i.e., intel_s10sx_pac:pac_s10_usm)* <br/>
1717
_Notice: This tutorial demonstrates an implementation of host streaming that will be supplanted by better techniques in a future release. See the [Drawbacks and Future Work](#drawbacks-and-future-work)_
1818

1919
## Purpose
@@ -114,7 +114,7 @@ When compiling for FPGA hardware, it is recommended to increase the job timeout
114114
```
115115
You can also compile for a custom FPGA platform with SYCL USM support. Ensure that the board support package is installed on your system. Then run `cmake` using the command:
116116
```
117-
cmake .. -DFPGA_BOARD=<board-support-package>:<board-variant>
117+
cmake .. -DFPGA_BOARD=<board-support-package>:<board-variant> -DUSM_HOST_ALLOCATIONS_ENABLED=1
118118
```
119119

120120
2. Compile the design through the generated `Makefile`. The following build targets are provided, matching the recommended development flow:
@@ -146,7 +146,7 @@ When compiling for FPGA hardware, it is recommended to increase the job timeout
146146
```
147147
You can also compile for a custom FPGA platform with SYCL USM support. Ensure that the board support package is installed on your system. Then run `cmake` using the command:
148148
```
149-
cmake -G "NMake Makefiles" .. -DFPGA_BOARD=<board-support-package>:<board-variant>
149+
cmake -G "NMake Makefiles" .. -DFPGA_BOARD=<board-support-package>:<board-variant> -DUSM_HOST_ALLOCATIONS_ENABLED=1
150150
```
151151

152152
2. Compile the design through the generated `Makefile`. The following build targets are provided, matching the recommended development flow:

DirectProgramming/DPC++FPGA/Tutorials/DesignPatterns/buffered_host_streaming/src/CMakeLists.txt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,22 @@ set(EMULATOR_TARGET ${TARGET_NAME}.fpga_emu)
77
set(FPGA_TARGET ${TARGET_NAME}.fpga)
88
set(REPORTS_TARGET ${TARGET_NAME}_report)
99

10-
# USM is only supported on the PAC S10 board
11-
set(FPGA_BOARD "intel_s10sx_pac:pac_s10_usm")
10+
# FPGA board selection
11+
if(NOT DEFINED FPGA_BOARD)
12+
set(FPGA_BOARD "intel_s10sx_pac:pac_s10_usm")
13+
message(STATUS "FPGA_BOARD was not specified.\
14+
\nConfiguring the design to run on the default FPGA board ${FPGA_BOARD} (Intel(R) PAC with Intel Stratix(R) 10 SX FPGA with USM support). \
15+
\nPlease refer to the README for information on board selection.")
16+
else()
17+
message(STATUS "Configuring the design to run on FPGA board ${FPGA_BOARD}")
18+
endif()
19+
20+
# this tutorial requires USM host allocations. Check the BSP name (which should contain the text 'usm')
21+
# to ensure the BSP has the required support. Allow the user to define USM_HOST_ALLOCATIONS_ENABLED
22+
# to override this check (e.g., cmake .. -DUSM_HOST_ALLOCATIONS_ENABLED=1)
23+
if(NOT FPGA_BOARD MATCHES ".usm.*" AND NOT DEFINED USM_HOST_ALLOCATIONS_ENABLED)
24+
message(FATAL_ERROR "This tutorial requires a BSP that has USM host allocations enabled")
25+
endif()
1226

1327
if(UNIX)
1428
set(THREAD_FLAG "-lpthread")

DirectProgramming/DPC++FPGA/Tutorials/DesignPatterns/simple_host_streaming/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ The [oneAPI Programming Guide](https://software.intel.com/en-us/oneapi-programmi
1313
| What you will learn | How to achieve low-latency host-device streaming while maintaining throughput
1414
| Time to complete | 45 minutes
1515

16-
_Notice: SYCL USM host allocations (and therefore this tutorial) are only supported for the Intel&reg; FPGA PAC D5005 (with Intel Stratix&reg; 10 SX)_
17-
_Notice: This tutorial demonstrates an implementation of host streaming that will be supplanted by better techniques in a future release. See the [Drawbacks and Future Work](#drawbacks-and-future-work)_
16+
*Notice: SYCL USM host allocations (and therefore this tutorial) are only supported for the Intel&reg; FPGA PAC D5005 (with Intel Stratix&reg; 10 SX) with USM support (i.e., intel_s10sx_pac:pac_s10_usm)* <br/>
17+
*Notice: This tutorial demonstrates an implementation of host streaming that will be supplanted by better techniques in a future release. See the [Drawbacks and Future Work](#drawbacks-and-future-work)*
1818

1919
## Purpose
2020
The purpose of this tutorial is to show you how to take advantage of SYCL USM host allocations and zero-copy host memory to implement a streaming host-device design with low latency and high throughput. Before starting this tutorial, we recommend first reviewing the **Pipes** (pipes) and **Zero-Copy Data Transfer** (zero_copy_data_transfer) FPGA tutorials, which will teach you more about SYCL pipes and SYCL USM and zero-copy data transfers, respectively.
@@ -113,7 +113,7 @@ When compiling for FPGA hardware, it is recommended to increase the job timeout
113113
```
114114
You can also compile for a custom FPGA platform with SYCL USM support. Ensure that the board support package is installed on your system. Then run `cmake` using the command:
115115
```
116-
cmake .. -DFPGA_BOARD=<board-support-package>:<board-variant>
116+
cmake .. -DFPGA_BOARD=<board-support-package>:<board-variant> -DUSM_HOST_ALLOCATIONS_ENABLED=1
117117
```
118118

119119
2. Compile the design through the generated `Makefile`. The following build targets are provided, matching the recommended development flow:
@@ -144,7 +144,7 @@ When compiling for FPGA hardware, it is recommended to increase the job timeout
144144
```
145145
You can also compile for a custom FPGA platform with SYCL USM support. Ensure that the board support package is installed on your system. Then run `cmake` using the command:
146146
```
147-
cmake -G "NMake Makefiles" .. -DFPGA_BOARD=<board-support-package>:<board-variant>
147+
cmake -G "NMake Makefiles" .. -DFPGA_BOARD=<board-support-package>:<board-variant> -DUSM_HOST_ALLOCATIONS_ENABLED=1
148148
```
149149

150150
2. Compile the design through the generated `Makefile`. The following build targets are provided, matching the recommended development flow:

DirectProgramming/DPC++FPGA/Tutorials/DesignPatterns/simple_host_streaming/src/CMakeLists.txt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,22 @@ set(EMULATOR_TARGET ${TARGET_NAME}.fpga_emu)
77
set(FPGA_TARGET ${TARGET_NAME}.fpga)
88
set(REPORTS_TARGET ${TARGET_NAME}_report)
99

10-
# USM is only supported on the PAC S10 board
11-
set(FPGA_BOARD "intel_s10sx_pac:pac_s10_usm")
10+
# FPGA board selection
11+
if(NOT DEFINED FPGA_BOARD)
12+
set(FPGA_BOARD "intel_s10sx_pac:pac_s10_usm")
13+
message(STATUS "FPGA_BOARD was not specified.\
14+
\nConfiguring the design to run on the default FPGA board ${FPGA_BOARD} (Intel(R) PAC with Intel Stratix(R) 10 SX FPGA with USM support). \
15+
\nPlease refer to the README for information on board selection.")
16+
else()
17+
message(STATUS "Configuring the design to run on FPGA board ${FPGA_BOARD}")
18+
endif()
19+
20+
# this tutorial requires USM host allocations. Check the BSP name (which should contain the text 'usm')
21+
# to ensure the BSP has the required support. Allow the user to define USM_HOST_ALLOCATIONS_ENABLED
22+
# to override this check (e.g., cmake .. -DUSM_HOST_ALLOCATIONS_ENABLED=1)
23+
if(NOT FPGA_BOARD MATCHES ".usm.*" AND NOT DEFINED USM_HOST_ALLOCATIONS_ENABLED)
24+
message(FATAL_ERROR "This tutorial requires a BSP that has USM host allocations enabled")
25+
endif()
1226

1327
# This is a Windows-specific flag that enables exception handling in host code
1428
if(WIN32)

DirectProgramming/DPC++FPGA/Tutorials/DesignPatterns/zero_copy_data_transfer/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The [oneAPI Programming Guide](https://software.intel.com/en-us/oneapi-programmi
1313
| What you will learn | How to use SYCL USM host allocations for the FPGA
1414
| Time to complete | 15 minutes
1515

16-
_Notice: SYCL USM host allocations (and therefore this tutorial) are only supported for the Intel&reg; FPGA PAC D5005 (with Intel Stratix&reg; 10 SX)_
16+
*Notice: SYCL USM host allocations (and therefore this tutorial) are only supported for the Intel&reg; FPGA PAC D5005 (with Intel Stratix&reg; 10 SX) with USM support (i.e., intel_s10sx_pac:pac_s10_usm)*
1717

1818
## Purpose
1919
The purpose of this tutorial is to show you how to take advantage of zero-copy host memory for the FPGA to improve the performance of your design. On FPGA, DPC++ implements all host and shared allocations as *zero-copy* data in host memory. This means that the FPGA will access the data directly over PCIe, which can improve performance in cases where there is little or no temporal reuse of data in the FPGA kernel. This tutorial includes two different kernels: one using traditional SYCL buffers (`src/buffer_kernel.hpp`) and one using USM host allocations (`src/restricted_usm_kernel.hpp`) that takes advantage of zero-copy host memory. Before completing this tutorial, it is suggested you review the **Explicit USM** (explicit_usm) tutorial.
@@ -78,7 +78,7 @@ When compiling for FPGA hardware, it is recommended to increase the job timeout
7878
```
7979
You can also compile for a custom FPGA platform with SYCL USM support. Ensure that the board support package is installed on your system. Then run `cmake` using the command:
8080
```
81-
cmake .. -DFPGA_BOARD=<board-support-package>:<board-variant>
81+
cmake .. -DFPGA_BOARD=<board-support-package>:<board-variant> -DUSM_HOST_ALLOCATIONS_ENABLED=1
8282
```
8383

8484
2. Compile the design through the generated `Makefile`. The following build targets are provided, matching the recommended development flow:
@@ -111,7 +111,7 @@ When compiling for FPGA hardware, it is recommended to increase the job timeout
111111
```
112112
You can also compile for a custom FPGA platform with SYCL USM support. Ensure that the board support package is installed on your system. Then run `cmake` using the command:
113113
```
114-
cmake -G "NMake Makefiles" .. -DFPGA_BOARD=<board-support-package>:<board-variant>
114+
cmake -G "NMake Makefiles" .. -DFPGA_BOARD=<board-support-package>:<board-variant> -DUSM_HOST_ALLOCATIONS_ENABLED=1
115115
```
116116

117117
2. Compile the design through the generated `Makefile`. The following build targets are provided, matching the recommended development flow:

DirectProgramming/DPC++FPGA/Tutorials/DesignPatterns/zero_copy_data_transfer/src/CMakeLists.txt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,22 @@ set(EMULATOR_TARGET ${TARGET_NAME}.fpga_emu)
77
set(FPGA_TARGET ${TARGET_NAME}.fpga)
88
set(REPORTS_TARGET ${TARGET_NAME}_report)
99

10-
# USM is only supported on the PAC S10 board
11-
set(FPGA_BOARD "intel_s10sx_pac:pac_s10_usm")
10+
# FPGA board selection
11+
if(NOT DEFINED FPGA_BOARD)
12+
set(FPGA_BOARD "intel_s10sx_pac:pac_s10_usm")
13+
message(STATUS "FPGA_BOARD was not specified.\
14+
\nConfiguring the design to run on the default FPGA board ${FPGA_BOARD} (Intel(R) PAC with Intel Stratix(R) 10 SX FPGA with USM support). \
15+
\nPlease refer to the README for information on board selection.")
16+
else()
17+
message(STATUS "Configuring the design to run on FPGA board ${FPGA_BOARD}")
18+
endif()
19+
20+
# this tutorial requires USM host allocations. Check the BSP name (which should contain the text 'usm')
21+
# to ensure the BSP has the required support. Allow the user to define USM_HOST_ALLOCATIONS_ENABLED
22+
# to override this check (e.g., cmake .. -DUSM_HOST_ALLOCATIONS_ENABLED=1)
23+
if(NOT FPGA_BOARD MATCHES ".usm.*" AND NOT DEFINED USM_HOST_ALLOCATIONS_ENABLED)
24+
message(FATAL_ERROR "This tutorial requires a BSP that has USM host allocations enabled")
25+
endif()
1226

1327
# This is a Windows-specific flag that enables exception handling in host code
1428
if(WIN32)

0 commit comments

Comments
 (0)