Skip to content

Commit

Permalink
Review comment changes
Browse files Browse the repository at this point in the history
Signed-off-by: Akshay Tondak <[email protected]>
  • Loading branch information
Akshay Tondak authored and Akshay Tondak committed Oct 10, 2024
1 parent 2d6059b commit 90f3948
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ TestAIEReconfigOverhead::run(std::shared_ptr<xrt_core::device> dev)

size_t instr_size = 0;
try {
instr_size = XrtSmi::Validate::get_instr_size(dpu_instr);
instr_size = XBValidateUtils::get_instr_size(dpu_instr);
}
catch(const std::exception& ex) {
logger(ptree, "Error", ex.what());
Expand All @@ -124,7 +124,7 @@ TestAIEReconfigOverhead::run(std::shared_ptr<xrt_core::device> dev)
argno++;
xrt::bo bo_mc(working_dev, 16, XRT_BO_FLAGS_HOST_ONLY, kernel.group_id(argno++));

XrtSmi::Validate::init_instr_buf(bo_instr, dpu_instr);
XBValidateUtils::init_instr_buf(bo_instr, dpu_instr);
//Create ctrlcode with NOPs
std::memset(bo_instr_no_op.map<char*>(), 0, instr_size);

Expand Down
4 changes: 2 additions & 2 deletions src/runtime_src/core/tools/common/tests/TestDF_bandwidth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ TestDF_bandwidth::run(std::shared_ptr<xrt_core::device> dev)

size_t instr_size = 0;
try {
instr_size = XrtSmi::Validate::get_instr_size(dpu_instr);
instr_size = XBValidateUtils::get_instr_size(dpu_instr);
}
catch(const std::exception& ex) {
logger(ptree, "Error", ex.what());
Expand All @@ -122,7 +122,7 @@ TestDF_bandwidth::run(std::shared_ptr<xrt_core::device> dev)
xrt::bo bo_ofm(working_dev, buffer_size, XRT_BO_FLAGS_HOST_ONLY, kernel.group_id(3));
xrt::bo bo_instr(working_dev, instr_size*sizeof(int), XCL_BO_FLAGS_CACHEABLE, kernel.group_id(5));

XrtSmi::Validate::init_instr_buf(bo_instr, dpu_instr);
XBValidateUtils::init_instr_buf(bo_instr, dpu_instr);

// map input buffer
auto ifm_mapped = bo_ifm.map<int*>();
Expand Down
6 changes: 3 additions & 3 deletions src/runtime_src/core/tools/common/tests/TestGemm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ TestGemm::run(std::shared_ptr<xrt_core::device> dev)

size_t instr_size = 0;
try {
instr_size = XrtSmi::Validate::get_instr_size(dpu_instr);
instr_size = XBValidateUtils::get_instr_size(dpu_instr);
}
catch(const std::exception& ex) {
logger(ptree, "Error", ex.what());
Expand All @@ -123,7 +123,7 @@ TestGemm::run(std::shared_ptr<xrt_core::device> dev)

//Create Instruction BO
xrt::bo bo_instr(working_dev, instr_size*sizeof(int), XCL_BO_FLAGS_CACHEABLE, kernel.group_id(5));
XrtSmi::Validate::init_instr_buf(bo_instr, dpu_instr);
XBValidateUtils::init_instr_buf(bo_instr, dpu_instr);
//Sync Instruction BO
bo_instr.sync(XCL_BO_SYNC_BO_TO_DEVICE);

Expand All @@ -132,7 +132,7 @@ TestGemm::run(std::shared_ptr<xrt_core::device> dev)

// wait until clock reaches the max frequency
int ipu_hclock = 0;
XrtSmi::Validate::wait_for_max_clock(ipu_hclock, dev);
XBValidateUtils::wait_for_max_clock(ipu_hclock, dev);

try {
//run kernel
Expand Down
4 changes: 2 additions & 2 deletions src/runtime_src/core/tools/common/tests/TestTCTAllColumn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ TestTCTAllColumn::run(std::shared_ptr<xrt_core::device> dev)

size_t instr_size = 0;
try {
instr_size = XrtSmi::Validate::get_instr_size(dpu_instr);
instr_size = XBValidateUtils::get_instr_size(dpu_instr);
}
catch(const std::exception& ex) {
logger(ptree, "Error", ex.what());
Expand All @@ -119,7 +119,7 @@ TestTCTAllColumn::run(std::shared_ptr<xrt_core::device> dev)
xrt::bo bo_ofm(working_dev, 4*buffer_size, XRT_BO_FLAGS_HOST_ONLY, kernel.group_id(3));
xrt::bo bo_instr(working_dev, instr_size*sizeof(int), XCL_BO_FLAGS_CACHEABLE, kernel.group_id(5));

XrtSmi::Validate::init_instr_buf(bo_instr, dpu_instr);
XBValidateUtils::init_instr_buf(bo_instr, dpu_instr);

// map input buffer
auto ifm_mapped = bo_ifm.map<int*>();
Expand Down
4 changes: 2 additions & 2 deletions src/runtime_src/core/tools/common/tests/TestTCTOneColumn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ TestTCTOneColumn::run(std::shared_ptr<xrt_core::device> dev)

size_t instr_size = 0;
try {
instr_size = XrtSmi::Validate::get_instr_size(dpu_instr);
instr_size = XBValidateUtils::get_instr_size(dpu_instr);
}
catch(const std::exception& ex) {
logger(ptree, "Error", ex.what());
Expand All @@ -119,7 +119,7 @@ TestTCTOneColumn::run(std::shared_ptr<xrt_core::device> dev)
xrt::bo bo_ofm(working_dev, 4*buffer_size, XRT_BO_FLAGS_HOST_ONLY, kernel.group_id(3));
xrt::bo bo_instr(working_dev, instr_size*sizeof(int), XCL_BO_FLAGS_CACHEABLE, kernel.group_id(5));

XrtSmi::Validate::init_instr_buf(bo_instr, dpu_instr);
XBValidateUtils::init_instr_buf(bo_instr, dpu_instr);

// map input buffer
auto ifm_mapped = bo_ifm.map<int*>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ BO_set::BO_set(const xrt::device& device, const xrt::kernel& kernel, const std::
// Create a no-op instruction if no instruction file is provided
std::memset(bo_instr.map<char*>(), (uint8_t)0, buffer_size);
} else {
size_t instr_size = XrtSmi::Validate::get_instr_size(dpu_instr);
size_t instr_size = XBValidateUtils::get_instr_size(dpu_instr);
bo_instr = xrt::bo(device, instr_size, XCL_BO_FLAGS_CACHEABLE, kernel.group_id(5));
}
}
Expand Down Expand Up @@ -88,8 +88,7 @@ TestCase::run()
}
}

namespace XrtSmi{
namespace Validate{
namespace XBValidateUtils{

// Copy values from text files into buff, expecting values are ascii encoded hex
void
Expand Down Expand Up @@ -169,5 +168,4 @@ wait_for_max_clock(int& ipu_hclock, std::shared_ptr<xrt_core::device> dev) {
}
}

}// end of namespace Validate
}// end of namespace XrtSmi
}// end of namespace XBValidateUtils
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,12 @@ class TestCase {
void run();
};

namespace XrtSmi{
namespace Validate{

namespace XBValidateUtils{

void init_instr_buf(xrt::bo &bo_instr, const std::string& dpu_file);
size_t get_instr_size(const std::string& dpu_file);
void wait_for_max_clock(int&, std::shared_ptr<xrt_core::device>);

} //End of namespace Validate
} //End of namespace XrtSmi
} //End of namespace XBValidateUtils
#endif

0 comments on commit 90f3948

Please sign in to comment.