Skip to content

Commit b0c2f81

Browse files
authored
FPGA: Fix inconsistent device flags in 4 samples (oneapi-src#1384)
Some of the samples required the device flags to be set using -DDEVICE_FLAG=-DAgilex rather than -DDEVICE_FLAG=Agilex. This change makes all the samples consistent with the second option.
1 parent 6b896c1 commit b0c2f81

File tree

4 files changed

+21
-20
lines changed

4 files changed

+21
-20
lines changed

DirectProgramming/C++SYCL_FPGA/Tutorials/DesignPatterns/shannonization/src/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ endif()
2626

2727
if(NOT DEFINED DEVICE_FLAG)
2828
message(FATAL_ERROR "An unrecognized or custom board was passed, but DEVICE_FLAG was not specified. \
29-
Please make sure you have set -DDEVICE_FLAG=-DA10, -DDEVICE_FLAG=-DS10 or \
30-
-DDEVICE_FLAG=-DAgilex.")
29+
Please make sure you have set -DDEVICE_FLAG=-A10, -DDEVICE_FLAG=-S10 or \
30+
-DDEVICE_FLAG=-Agilex.")
3131
endif()
3232

3333
# This is a Windows-specific flag that enables exception handling in host code

DirectProgramming/C++SYCL_FPGA/Tutorials/Features/loop_initiation_interval/src/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ endif()
2828

2929
if(NOT DEFINED DEVICE_FLAG)
3030
message(FATAL_ERROR "An unrecognized or custom board was passed, but DEVICE_FLAG was not specified. \
31-
Please make sure you have set -DDEVICE_FLAG=-DA10, -DDEVICE_FLAG=-DS10 or \
32-
-DDEVICE_FLAG=-DAgilex.")
31+
Please make sure you have set -DDEVICE_FLAG=-A10, -DDEVICE_FLAG=-S10 or \
32+
-DDEVICE_FLAG=-Agilex.")
3333
endif()
3434

3535
# This is a Windows-specific flag that enables exception handling in host code

DirectProgramming/C++SYCL_FPGA/Tutorials/Features/optimization_levels/minimum_latency/src/CMakeLists.txt

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,30 @@ set(FPGA_TARGET_MANUAL_REVERT ${TARGET_NAME_MANUAL_REVERT}.fpga)
2020
# FPGA board selection
2121
if(NOT DEFINED FPGA_DEVICE)
2222
set(FPGA_DEVICE "Agilex")
23-
set(DEVICE_FLAG "-DAgilex")
23+
set(DEVICE_FLAG "Agilex")
2424
set(MANUAL_REVERT_FLAGS "-Xshyper-optimized-handshaking=on -Xssfc-exit-fifo-type=default")
2525
message(STATUS "FPGA_DEVICE was not specified.\
2626
\nConfiguring the design to the default FPGA family: ${FPGA_DEVICE}\
2727
\nPlease refer to the README for information on target selection.")
2828
else()
29-
if(FPGA_DEVICE MATCHES ".*a10*")
30-
set(DEVICE_FLAG "-DA10")
29+
string(TOLOWER ${FPGA_DEVICE} FPGA_DEVICE_NAME)
30+
if(FPGA_DEVICE_NAME MATCHES ".*a10*")
31+
set(DEVICE_FLAG "A10")
3132
set(MANUAL_REVERT_FLAGS "-Xssfc-exit-fifo-type=default")
32-
elseif(FPGA_DEVICE MATCHES ".*s10*")
33-
set(DEVICE_FLAG "-DS10")
33+
elseif(FPGA_DEVICE_NAME MATCHES ".*s10*")
34+
set(DEVICE_FLAG "S10")
3435
set(MANUAL_REVERT_FLAGS "-Xshyper-optimized-handshaking=on -Xssfc-exit-fifo-type=default")
35-
elseif(FPGA_DEVICE MATCHES ".*agilex*")
36-
set(DEVICE_FLAG "-DAgilex")
36+
elseif(FPGA_DEVICE_NAME MATCHES ".*agilex*")
37+
set(DEVICE_FLAG "Agilex")
3738
set(MANUAL_REVERT_FLAGS "-Xshyper-optimized-handshaking=on -Xssfc-exit-fifo-type=default")
3839
endif()
3940
message(STATUS "Configuring the design with the following target: ${FPGA_DEVICE}")
4041
endif()
4142

4243
if(NOT DEFINED DEVICE_FLAG)
4344
message(FATAL_ERROR "An unrecognized or custom board was passed, but DEVICE_FLAG was not specified. \
44-
Please make sure you have set -DDEVICE_FLAG=-DA10, -DDEVICE_FLAG=-DS10 or \
45-
-DDEVICE_FLAG=-DAgilex.")
45+
Please make sure you have set -DDEVICE_FLAG=A10, -DDEVICE_FLAG=S10 or \
46+
-DDEVICE_FLAG=Agilex.")
4647
endif()
4748

4849
# This is a Windows-specific flag that enables exception handling in host code
@@ -54,12 +55,12 @@ endif()
5455
# 1. The "compile" stage compiles the device code to an intermediate representation (SPIR-V).
5556
# 2. The "link" stage invokes the compiler's FPGA backend before linking.
5657
# For this reason, FPGA backend flags must be passed as link flags in CMake.
57-
set(EMULATOR_COMPILE_FLAGS "-Wall ${WIN_FLAG} -fsycl -fintelfpga -DFPGA_EMULATOR ${DEVICE_FLAG}")
58+
set(EMULATOR_COMPILE_FLAGS "-Wall ${WIN_FLAG} -fsycl -fintelfpga -DFPGA_EMULATOR -D${DEVICE_FLAG}")
5859
set(EMULATOR_LINK_FLAGS "-fsycl -fintelfpga")
59-
set(SIMULATOR_COMPILE_FLAGS "-Wall ${WIN_FLAG} -fsycl -fintelfpga -DFPGA_SIMULATOR ${DEVICE_FLAG}")
60-
set(SIMULATOR_LINK_FLAGS "-fsycl -fintelfpga -Xssimulation -Xstarget=${FPGA_DEVICE} ${DEVICE_FLAG} ${USER_HARDWARE_FLAGS}")
61-
set(HARDWARE_COMPILE_FLAGS "-Wall ${WIN_FLAG} -fsycl -fintelfpga -DFPGA_HARDWARE ${DEVICE_FLAG}")
62-
set(HARDWARE_LINK_FLAGS "-fsycl -fintelfpga -Xshardware -Xstarget=${FPGA_DEVICE} ${DEVICE_FLAG} ${USER_HARDWARE_FLAGS}")
60+
set(SIMULATOR_COMPILE_FLAGS "-Wall ${WIN_FLAG} -fsycl -fintelfpga -DFPGA_SIMULATOR -D${DEVICE_FLAG}")
61+
set(SIMULATOR_LINK_FLAGS "-fsycl -fintelfpga -Xssimulation -Xstarget=${FPGA_DEVICE} -D${DEVICE_FLAG} ${USER_HARDWARE_FLAGS}")
62+
set(HARDWARE_COMPILE_FLAGS "-Wall ${WIN_FLAG} -fsycl -fintelfpga -DFPGA_HARDWARE -D${DEVICE_FLAG}")
63+
set(HARDWARE_LINK_FLAGS "-fsycl -fintelfpga -Xshardware -Xstarget=${FPGA_DEVICE} -D${DEVICE_FLAG} ${USER_HARDWARE_FLAGS}")
6364
# use cmake -D USER_HARDWARE_FLAGS=<flags> to set extra flags for FPGA backend compilation
6465

6566
###############################################################################

DirectProgramming/C++SYCL_FPGA/Tutorials/Features/speculated_iterations/src/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ endif()
2626

2727
if(NOT DEFINED DEVICE_FLAG)
2828
message(FATAL_ERROR "An unrecognized or custom board was passed, but DEVICE_FLAG was not specified. \
29-
Please make sure you have set -DDEVICE_FLAG=-DA10, -DDEVICE_FLAG=-DS10 or \
30-
-DDEVICE_FLAG=-DAgilex.")
29+
Please make sure you have set -DDEVICE_FLAG=-A10, -DDEVICE_FLAG=-S10 or \
30+
-DDEVICE_FLAG=-Agilex.")
3131
endif()
3232

3333
# This is a Windows-specific flag that enables exception handling in host code

0 commit comments

Comments
 (0)