Skip to content

Commit f676c76

Browse files
authored
FPGA: Move the simple-add and vector-add samples to the IP Authoring flow (#1369)
1 parent ae189df commit f676c76

File tree

4 files changed

+67
-24
lines changed

4 files changed

+67
-24
lines changed

DirectProgramming/C++SYCL/DenseLinearAlgebra/simple-add/README.md

+33-5
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ USM, buffer, accessor, kernel, and command groups.
2222
| Optimized for | Description
2323
|:--- |:---
2424
| OS | Ubuntu* 18.04 <br> Windows* 10
25-
| Hardware | GEN9 or newer <br> Intel® Programmable Acceleration Card with Intel® Arria® 10 GX FPGA (Intel® PAC with Intel® Arria® 10 GX FPGA)
25+
| Hardware | GEN9 or newer <br> Intel® Agilex®, Arria® 10, and Stratix® 10 FPGAs
2626
| Software | Intel® oneAPI DPC++/C++ Compiler
2727

28+
2829
> **Note**: Even though the Intel DPC++/C++ OneAPI compiler is enough to compile for CPU, GPU, FPGA emulation, generating FPGA reports and generating RTL for FPGAs, there are extra software requirements for the FPGA simulation flow and FPGA compiles.
2930
>
3031
> For using the simulator flow, Intel® Quartus® Prime Pro Edition and one of the following simulators must be installed and accessible through your PATH:
@@ -33,6 +34,7 @@ USM, buffer, accessor, kernel, and command groups.
3334
> - ModelSim® SE
3435
>
3536
> When using the hardware compile flow, Intel® Quartus® Prime Pro Edition must be installed and accessible through your PATH.
37+
> **Warning** Make sure you add the device files associated with the FPGA that you are targeting to your Intel® Quartus® Prime installation.
3638
3739
## Key Implementation Details
3840

@@ -103,6 +105,19 @@ To learn more about the extensions and how to configure the oneAPI environment,
103105
cmake .. -DUSM=1
104106
```
105107

108+
> **Note**: When building for FPGAs, the default FPGA family will be used (Intel® Agilex®).
109+
> You can change the default target by using the command:
110+
> ```
111+
> cmake .. -DFPGA_DEVICE=<FPGA device family or FPGA part number>
112+
> ```
113+
>
114+
> Alternatively, you can target an explicit FPGA board variant and BSP by using the following command:
115+
> ```
116+
> cmake .. -DFPGA_DEVICE=<board-support-package>:<board-variant>
117+
> ```
118+
>
119+
> You will only be able to run an executable on the FPGA if you specified a BSP.
120+
106121
#### Build for CPU and GPU
107122
108123
1. Build the program.
@@ -162,6 +177,19 @@ time.)
162177
cmake -G "NMake Makefiles" .. -DUSM=1
163178
```
164179
180+
> **Note**: When building for FPGAs, the default FPGA family will be used (Intel® Agilex®).
181+
> You can change the default target by using the command:
182+
> ```
183+
> cmake -G "NMake Makefiles" .. -DFPGA_DEVICE=<FPGA device family or FPGA part number>
184+
> ```
185+
>
186+
> Alternatively, you can target an explicit FPGA board variant and BSP by using the following command:
187+
> ```
188+
> cmake -G "NMake Makefiles" .. -DFPGA_DEVICE=<board-support-package>:<board-variant>
189+
> ```
190+
>
191+
> You will only be able to run an executable on the FPGA if you specified a BSP.
192+
165193
#### Build for CPU and GPU
166194
167195
1. Build the program.
@@ -238,7 +266,7 @@ If you receive an error message, troubleshoot the problem using the **Diagnostic
238266
CL_CONTEXT_MPSIM_DEVICE_INTELFPGA=1 ./simple-add-buffers.fpga_sim
239267
CL_CONTEXT_MPSIM_DEVICE_INTELFPGA=1 ./simple-add-usm.fpga_sim
240268
```
241-
4. Run on FPGA hardware.
269+
4. Run on FPGA hardware (only if you ran `cmake` with `-DFPGA_DEVICE=<board-support-package>:<board-variant>`).
242270
```
243271
./simple-add-buffers.fpga
244272
./simple-add-usm.fpga
@@ -272,7 +300,7 @@ If you receive an error message, troubleshoot the problem using the **Diagnostic
272300
simple-add-usm.fpga_sim.exe
273301
set CL_CONTEXT_MPSIM_DEVICE_INTELFPGA=
274302
```
275-
4. Run on FPGA hardware.
303+
4. Run on FPGA hardware (only if you ran `cmake` with `-DFPGA_DEVICE=<board-support-package>:<board-variant>`).
276304
```
277305
simple-add-buffers.fpga.exe
278306
simple-add-usm.fpga.exe
@@ -298,8 +326,8 @@ qsub -I -l nodes=1:gpu:ppn=2 -d .
298326
299327
|Available Nodes |Command Options
300328
|:--- |:---
301-
|GPU |`qsub -l nodes=1:gpu:ppn=2 -d .`
302-
|CPU |`qsub -l nodes=1:xeon:ppn=2 -d .`
329+
|GPU |`qsub -l nodes=1:gpu:ppn=2 -d .`
330+
|CPU |`qsub -l nodes=1:xeon:ppn=2 -d .`
303331
|FPGA Compile Time |`qsub -l nodes=1:fpga_compile:ppn=2 -d .`
304332
|FPGA Runtime (Arria 10) |`qsub -l nodes=1:fpga_runtime:arria10:ppn=2 -d .`
305333

DirectProgramming/C++SYCL/DenseLinearAlgebra/simple-add/src/CMakeLists.txt

+2-8
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,9 @@ add_custom_target(cpu-gpu DEPENDS ${TARGET_NAME})
4848

4949
# FPGA device selection
5050
if(NOT DEFINED FPGA_DEVICE)
51-
if(DEFINED USM AND (NOT(USM EQUAL 0)))
52-
set(FPGA_DEVICE "intel_s10sx_pac:pac_s10_usm")
53-
set(DEFAULT_BOARD_STR "Intel Stratix(R) 10 SX with USM support")
54-
else()
55-
set(FPGA_DEVICE "intel_a10gx_pac:pac_a10")
56-
set(DEFAULT_BOARD_STR "Intel Arria(R) 10 GX")
57-
endif()
51+
set(FPGA_DEVICE "Agilex")
5852
message(STATUS "FPGA_DEVICE was not specified.\
59-
\nConfiguring the design to run on the default FPGA board ${FPGA_DEVICE} (Intel(R) PAC with ${DEFAULT_BOARD_STR} FPGA). \
53+
\nConfiguring the design to target the default FPGA family (Intel Agilex®). \
6054
\nPlease refer to the README for information on board selection.")
6155
else()
6256
message(STATUS "Configuring the design to run on FPGA device ${FPGA_DEVICE}")

DirectProgramming/C++SYCL/DenseLinearAlgebra/vector-add/README.md

+30-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This sample provides example implementations of both Unified Shared Memory (USM)
2525
| Optimized for | Description
2626
|:--- |:---
2727
| OS | Ubuntu* 18.04 <br> Windows* 10
28-
| Hardware | GEN9 or newer <br> Intel® Programmable Acceleration Card with Intel® Arria® 10 GX FPGA (Intel® PAC with Intel® Arria® 10 GX FPGA)
28+
| Hardware | GEN9 or newer <br> Intel® Agilex®, Arria® 10, and Stratix® 10 FPGAs
2929
| Software | Intel® oneAPI DPC++/C++ Compiler
3030

3131
> **Note**: Even though the Intel DPC++/C++ OneAPI compiler is enough to compile for CPU, GPU, FPGA emulation, generating FPGA reports and generating RTL for FPGAs, there are extra software requirements for the FPGA simulation flow and FPGA compiles.
@@ -36,6 +36,7 @@ This sample provides example implementations of both Unified Shared Memory (USM)
3636
> - ModelSim® SE
3737
>
3838
> When using the hardware compile flow, Intel® Quartus® Prime Pro Edition must be installed and accessible through your PATH.
39+
> **Warning** Make sure you add the device files associated with the FPGA that you are targeting to your Intel® Quartus® Prime installation.
3940
4041
## Key Implementation Details
4142

@@ -103,6 +104,19 @@ To learn more about the extensions and how to configure the oneAPI environment,
103104
cmake .. -DUSM=1
104105
```
105106

107+
> **Note**: When building for FPGAs, the default FPGA family will be used (Intel® Agilex®).
108+
> You can change the default target by using the command:
109+
> ```
110+
> cmake .. -DFPGA_DEVICE=<FPGA device family or FPGA part number>
111+
> ```
112+
>
113+
> Alternatively, you can target an explicit FPGA board variant and BSP by using the following command:
114+
> ```
115+
> cmake .. -DFPGA_DEVICE=<board-support-package>:<board-variant>
116+
> ```
117+
>
118+
> You will only be able to run an executable on the FPGA if you specified a BSP.
119+
106120
#### Build for CPU and GPU
107121
108122
1. Build the program.
@@ -162,6 +176,19 @@ time.)
162176
cmake -G "NMake Makefiles" .. -DUSM=1
163177
```
164178
179+
> **Note**: When building for FPGAs, the default FPGA family will be used (Intel® Agilex®).
180+
> You can change the default target by using the command:
181+
> ```
182+
> cmake -G "NMake Makefiles" .. -DFPGA_DEVICE=<FPGA device family or FPGA part number>
183+
> ```
184+
>
185+
> Alternatively, you can target an explicit FPGA board variant and BSP by using the following command:
186+
> ```
187+
> cmake -G "NMake Makefiles" .. -DFPGA_DEVICE=<board-support-package>:<board-variant>
188+
> ```
189+
>
190+
> You will only be able to run an executable on the FPGA if you specified a BSP.
191+
165192
#### Build for CPU and GPU
166193
167194
1. Build the program.
@@ -243,7 +270,7 @@ The source files (`vector-add-buffers.cpp` and `vector-add-usm.cpp`) specify the
243270
CL_CONTEXT_MPSIM_DEVICE_INTELFPGA=1 ./vector-add-buffers.fpga_sim
244271
CL_CONTEXT_MPSIM_DEVICE_INTELFPGA=1 ./vector-add-usm.fpga_sim
245272
```
246-
4. Run on FPGA hardware.
273+
4. Run on FPGA hardware (only if you ran `cmake` with `-DFPGA_DEVICE=<board-support-package>:<board-variant>`).
247274
```
248275
./vector-add-buffers.fpga
249276
./vector-add-usm.fpga
@@ -277,7 +304,7 @@ The source files (`vector-add-buffers.cpp` and `vector-add-usm.cpp`) specify the
277304
vector-add-usm.fpga_sim.exe
278305
set CL_CONTEXT_MPSIM_DEVICE_INTELFPGA=
279306
```
280-
4. Run on FPGA hardware.
307+
4. Run on FPGA hardware (only if you ran `cmake` with `-DFPGA_DEVICE=<board-support-package>:<board-variant>`).
281308
```
282309
vector-add-buffers.fpga.exe
283310
vector-add-usm.fpga.exe

DirectProgramming/C++SYCL/DenseLinearAlgebra/vector-add/src/CMakeLists.txt

+2-8
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,9 @@ add_custom_target(cpu-gpu DEPENDS ${TARGET_NAME})
4848

4949
# FPGA device selection
5050
if(NOT DEFINED FPGA_DEVICE)
51-
if(DEFINED USM AND (NOT(USM EQUAL 0)))
52-
set(FPGA_DEVICE "intel_s10sx_pac:pac_s10_usm")
53-
set(DEFAULT_BOARD_STR "Intel Stratix(R) 10 SX with USM support")
54-
else()
55-
set(FPGA_DEVICE "intel_a10gx_pac:pac_a10")
56-
set(DEFAULT_BOARD_STR "Intel Arria(R) 10 GX")
57-
endif()
51+
set(FPGA_DEVICE "Agilex")
5852
message(STATUS "FPGA_DEVICE was not specified.\
59-
\nConfiguring the design to run on the default FPGA board ${FPGA_DEVICE} (Intel(R) PAC with ${DEFAULT_BOARD_STR} FPGA). \
53+
\nConfiguring the design to target the default FPGA family (Intel Agilex®). \
6054
\nPlease refer to the README for information on board selection.")
6155
else()
6256
message(STATUS "Configuring the design to run on FPGA device ${FPGA_DEVICE}")

0 commit comments

Comments
 (0)