Skip to content

Commit b07d213

Browse files
Bhaskar VishnuVardhan ChebroluGitHub Enterprise
authored andcommitted
simplified hbm_simple host code by removing is_emulation() checks
1 parent 3de811e commit b07d213

File tree

2 files changed

+7
-30
lines changed

2 files changed

+7
-30
lines changed

host/hbm_simple/details.rst

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,20 @@ real log reported while running on U280 platform:
4343
::
4444

4545
Platform Name: Xilinx
46-
Found Device=xilinx_u280_xdma_201920_1
47-
INFO: Reading ./build_dir.hw.xilinx_u280_xdma_201920_1/krnl_vadd.xclbin
48-
Loading: './build_dir.hw.xilinx_u280_xdma_201920_1/krnl_vadd.xclbin'
46+
INFO: Reading ./build_dir.hw.xilinx_u50_gen3x16_xdma_201920_3/krnl_vadd.xclbin
47+
Loading: './build_dir.hw.xilinx_u50_gen3x16_xdma_201920_3/krnl_vadd.xclbin'
48+
Trying to program device[0]: xilinx_u50_gen3x16_xdma_201920_3
49+
Device[0]: program successful!
4950
Running CASE 1 : Single HBM for all three Buffers
50-
Picking Buffer size 67108864 so that all three buffer should fit into Single HBM (max 256MB)
5151
Each buffer is allocated with same HBM bank.
5252
input 1 -> bank 0
5353
input 2 -> bank 0
5454
output -> bank 0
55-
[CASE 1] THROUGHPUT = 9.54234 GB/s
55+
[CASE 1] THROUGHPUT = 8.0181 GB/s
5656
Running CASE 2: Three Separate Banks for Three Buffers
57-
For This case each buffer will be having different HBM, so buffer size is picked to utilize full HBM
58-
vector size is 268435456 as maximum possible inside single HBM
5957
Each buffer is allocated with different HBM bank.
6058
input 1 -> bank 1
6159
input 2 -> bank 2
6260
output -> bank 3
63-
[CASE 2] THROUGHPUT = 38.7406 GB/s
61+
[CASE 2] THROUGHPUT = 24.4078 GB/s
6462
TEST PASSED

host/hbm_simple/src/host.cpp

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,7 @@ int main(int argc, char* argv[]) {
217217
exit(EXIT_FAILURE);
218218
}
219219

220-
unsigned int dataSize = 64 * 1024 * 1024;
221-
if (xcl::is_emulation()) {
222-
dataSize = 1024;
223-
std::cout << "Original Dataset is reduced for faster execution on "
224-
"emulation flow. Data size="
225-
<< dataSize << std::endl;
226-
}
220+
unsigned int dataSize = 1024 * 1024;
227221

228222
std::vector<int, aligned_allocator<int> > source_in1(dataSize);
229223
std::vector<int, aligned_allocator<int> > source_in2(dataSize);
@@ -245,13 +239,6 @@ int main(int argc, char* argv[]) {
245239
int bank_assign[numBuf];
246240

247241
std::cout << "Running CASE 1 : Single HBM for all three Buffers " << std::endl;
248-
if (!xcl::is_emulation()) {
249-
dataSize = 16 * 1024 * 1024;
250-
std::cout << "Picking Buffer size " << dataSize * sizeof(uint32_t)
251-
<< " so that all three buffer should fit into Single HBM "
252-
"(max 256MB)"
253-
<< std::endl;
254-
}
255242

256243
std::cout << "Each buffer is allocated with same HBM bank." << std::endl;
257244
std::cout << "input 1 -> bank 0 " << std::endl;
@@ -273,14 +260,6 @@ int main(int argc, char* argv[]) {
273260
std::cout << "[CASE 1] THROUGHPUT = " << result << " GB/s" << std::endl;
274261

275262
std::cout << "Running CASE 2: Three Separate Banks for Three Buffers" << std::endl;
276-
if (!xcl::is_emulation()) {
277-
std::cout << "For This case each buffer will be having different HBM, "
278-
"so buffer size is picked to utilize full HBM"
279-
<< std::endl;
280-
dataSize = 64 * 1024 * 1024;
281-
std::cout << "vector size is " << dataSize * sizeof(uint32_t) << " as maximum possible inside single HBM"
282-
<< std::endl;
283-
}
284263

285264
std::cout << "Each buffer is allocated with different HBM bank." << std::endl;
286265
std::cout << "input 1 -> bank 1 " << std::endl;

0 commit comments

Comments
 (0)