Skip to content

Commit 1607cb7

Browse files
authored
FPGA: Update the gzip code sample to use LSU builtins (oneapi-src#2545)
The sample was relying on undocumented compiler flags. This change updated the sample to instead use the documented LSU builtins to achieve the same goal.
1 parent 575fba8 commit 1607cb7

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ message(STATUS "NUM_REORDER=${NUM_REORDER}")
135135

136136
# Use cmake -DUSER_FPGA_FLAGS=<flags> to set extra flags for FPGA backend
137137
# compilation.
138-
set(USER_FPGA_FLAGS ${USER_FPGA_FLAGS};${SEED};-Xsopt-arg=\"-nocaching\";${NUM_REORDER})
138+
set(USER_FPGA_FLAGS ${USER_FPGA_FLAGS};${SEED};${NUM_REORDER})
139139

140140
# Use cmake -DUSER_FLAGS=<flags> to set extra flags for general compilation.
141141
set(USER_FLAGS ${USER_FLAGS};-DNUM_ENGINES=${NUM_ENGINES})

DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/gzip/src/gzipkernel_ll.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ using acc_lz_to_crc_channel_array =
7676
32,
7777
NUM_ENGINES
7878
>;
79+
80+
using NonCachingLSU = sycl::ext::intel::lsu<sycl::ext::intel::burst_coalesce<true>,
81+
sycl::ext::intel::cache<0>,
82+
sycl::ext::intel::statically_coalesce<true>>;
7983

8084
template <int Begin, int End>
8185
struct Unroller {
@@ -2164,7 +2168,8 @@ event SubmitLZReduction(queue &q, size_t block_size, bool last_block,
21642168
// load in new data
21652169
struct LzInput in;
21662170
Unroller<0, kVec>::step([&](int i) {
2167-
in.data[i] = acc_pibuf[inpos++]; // Reads 16 bytes, just one time.
2171+
in.data[i] = NonCachingLSU::load(acc_pibuf + inpos); // Reads 16 bytes, just one time.
2172+
inpos++;
21682173
input_data.arr[i] =
21692174
in.data[i]; // Send a copy of the data to the CRC kernel, through
21702175
// a pipe. input_data is used to gang the data
@@ -2185,7 +2190,8 @@ event SubmitLZReduction(queue &q, size_t block_size, bool last_block,
21852190

21862191
// load in new data
21872192
Unroller<0, kVec>::step([&](int i) {
2188-
in.data[i] = acc_pibuf[inpos++];
2193+
in.data[i] = NonCachingLSU::load(acc_pibuf + inpos); // Reads 16 bytes, just one time.
2194+
inpos++;
21892195
input_data.arr[16 * (int)crc_ch_load_upper + i] = in.data[i];
21902196
});
21912197

0 commit comments

Comments
 (0)