Skip to content

Commit 6a8d7a9

Browse files
authored
FPGA: Unify the crr configuration across FPGA targets (#2335)
Modifies the CMakeLists for the CRR FPGA code sample so that we use the same unroll factors for all platforms and expose the option to modify these unroll factors to the users. The change also updates the readme to reflect these changes.
1 parent 5752fa8 commit 6a8d7a9

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/crr/CMakeLists.txt

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,23 +56,32 @@ if(NOT DEFINED DEVICE_FLAG)
5656
endif()
5757

5858
# Set design parameters according to the selected board
59-
if(DEVICE_FLAG MATCHES "A10")
60-
# A10 parameters
59+
if (DEFINED SET_OUTER_UNROLL)
60+
set(OUTER_UNROLL_V ${SET_OUTER_UNROLL})
61+
else()
6162
set(OUTER_UNROLL_V 1)
63+
endif()
64+
65+
if (DEFINED SET_INNER_UNROLL)
66+
set(INNER_UNROLL_V ${SET_INNER_UNROLL})
67+
else()
6268
set(INNER_UNROLL_V 64)
69+
endif()
70+
71+
if (DEFINED SET_OUTER_UNROLL_POW2)
72+
set(OUTER_UNROLL_POW2_V ${SET_OUTER_UNROLL_POW2})
73+
else()
6374
set(OUTER_UNROLL_POW2_V 1)
75+
endif()
76+
77+
if(DEVICE_FLAG MATCHES "A10")
78+
# A10 parameters
6479
set(SEED "-Xsseed=1")
6580
elseif(DEVICE_FLAG MATCHES "S10")
6681
# S10 parameters
67-
set(OUTER_UNROLL_V 2)
68-
set(INNER_UNROLL_V 64)
69-
set(OUTER_UNROLL_POW2_V 2)
7082
set(SEED "-Xsseed=3")
7183
elseif(DEVICE_FLAG MATCHES "Agilex7")
7284
# Agilex 7
73-
set(OUTER_UNROLL_V 2)
74-
set(INNER_UNROLL_V 64)
75-
set(OUTER_UNROLL_POW2_V 2)
7685
set(SEED "-Xsseed=4")
7786
else()
7887
message(FATAL_ERROR "Unknown board!")

DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/crr/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,11 @@ This design measures the FPGA performance to determine how many assets can be pr
128128

129129
| Flag | Description
130130
|:--- |:---
131-
|`-DOUTER_UNROLL=1` | Uses the value 1 for the constant OUTER_UNROLL, controls the number of CRRs that can be processed in parallel
132-
|`-DINNER_UNROLL=64` | Uses the value 64 for the constant INNER_UNROLL, controls the degree of parallelization within the calculation of 1 CRR
133-
|`-DOUTER_UNROLL_POW2=1` | Uses the value 1 for the constant OUTER_UNROLL_POW2, controls the number of memory banks
131+
|`-DSET_OUTER_UNROLL=<N>` | Sets the value for the constant OUTER_UNROLL to N, controls the number of CRRs that can be processed in parallel. The default value is 1 for all target platforms.
132+
|`-DSET_INNER_UNROLL=<N>` | Sets the value for the constant INNER_UNROLL to N, controls the degree of parallelization within the calculation of 1 CRR. The default value is 64 for all target platforms.
133+
|`-DSET_OUTER_UNROLL_POW2=<N>` | ets the value for the constant OUTER_UNROLL_POW2 to N, controls the number of memory banks. The default value is 1 for all target platforms.
134134

135-
> **Note**: The `Xsseed`, `DOUTER_UNROLL`, `DINNER_UNROLL`, and `DOUTER_UNROLL_POW2` values differ depending on the board being targeted. You can find more information about the unroll factors in `/src/CRR_common.hpp`.
135+
> **Note**: The `Xsseed` values differ depending on the board being targeted. You can find more information about the unroll factors in `/src/CRR_common.hpp`.
136136
137137
## Build the `CRR Binomial Tree` Sample
138138

0 commit comments

Comments
 (0)