Skip to content

Commit

Permalink
Refactoring umq df_bw xrt_test (#348)
Browse files Browse the repository at this point in the history
Signed-off-by: Hayden Laccabue <hlaccabu@amd.com>
  • Loading branch information
hlaccabu authored Jan 15, 2025
1 parent 86db3d0 commit 7385e68
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/xrt_test/xrt_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,9 @@ TEST_xrt_umq_df_bw(int device_index, arg_type& arg)

xrt_bo bo_ifm{device, rw_size, xrt::bo::flags::cacheable};
xrt_bo bo_ofm{device, rw_size, xrt::bo::flags::cacheable};
auto p = bo_ifm.map();
auto ifm_mapped = bo_ifm.map();
for (uint32_t i = 0; i < rw_size / sizeof(uint32_t); i++) {
p[i] = data;
ifm_mapped[i] = data;
}

// Setting args for patching control code buffer
Expand All @@ -335,11 +335,11 @@ TEST_xrt_umq_df_bw(int device_index, arg_type& arg)
throw std::runtime_error(std::string("bad command state: ") + std::to_string(state));

// Check result
p = bo_ofm.map();
auto ofm_mapped = bo_ofm.map();
int err = 0;
for (uint32_t i = 0; i < rw_size / sizeof(uint32_t); i++) {
if (p[i] != 0) {
std::cout << "error@" << i <<": " << p[i] << ", expecting: " << 0 << std::endl;
if (ofm_mapped[i] != ifm_mapped[i]) {
std::cout << "error@" << i <<": " << ofm_mapped[i] << ", expecting: " << ifm_mapped[i] << std::endl;
err++;
}
}
Expand Down

0 comments on commit 7385e68

Please sign in to comment.